import { MWMediaMeta } from "@/backend/metadata/types"; import { IconPatch } from "@/components/buttons/IconPatch"; import { Icon, Icons } from "@/components/Icon"; import { BrandPill } from "@/components/layout/BrandPill"; import { getIfBookmarkedFromPortable, useBookmarkContext, } from "@/state/bookmark"; import { AirplayControl } from "../controls/AirplayControl"; import { ChromeCastControl } from "../controls/ChromeCastControl"; interface VideoPlayerHeaderProps { media?: MWMediaMeta; onClick?: () => void; isMobile?: boolean; } export function VideoPlayerHeader(props: VideoPlayerHeaderProps) { const { bookmarkStore, setItemBookmark } = useBookmarkContext(); const isBookmarked = props.media ? getIfBookmarkedFromPortable(bookmarkStore.bookmarks, props.media) : false; const showDivider = props.media && props.onClick; return (

{props.onClick ? ( Back to home ) : null} {showDivider ? ( ) : null} {props.media ? ( {props.media.title} ) : null}

{props.media && ( props.media && setItemBookmark(props.media, !isBookmarked) } /> )}
{props.isMobile ? ( <> ) : ( )}
); }