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"; interface VideoPlayerHeaderProps { media?: MWMediaMeta; onClick?: () => void; } 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} props.media && setItemBookmark(props.media, !isBookmarked) } /> ) : null}

); }