1
0
Fork 0
mirror of https://github.com/sussy-code/smov.git synced 2024-12-22 14:57:40 +01:00
smov/src/components/video/controls/ShowTitleControl.tsx

20 lines
586 B
TypeScript
Raw Normal View History

import { useVideoPlayerState } from "../VideoContext";
export function ShowTitleControl() {
const { videoState } = useVideoPlayerState();
if (!videoState.seasonData.isSeries) return null;
if (!videoState.seasonData.title || !videoState.seasonData.current)
return null;
const cur = videoState.seasonData.current;
const selectedText = `S${cur.season} E${cur.episode}`;
return (
<p className="ml-8 select-none space-x-2 font-bold text-white">
<span>{selectedText}</span>
<span className="opacity-50">{videoState.seasonData.title}</span>
</p>
);
}