mirror of
https://github.com/movie-web/native-app.git
synced 2025-09-13 10:33:26 +00:00
46 lines
1.2 KiB
TypeScript
46 lines
1.2 KiB
TypeScript
import { Text, View } from "tamagui";
|
|
|
|
import { usePlayerStore } from "~/stores/player/store";
|
|
import { BrandPill } from "../BrandPill";
|
|
import { BackButton } from "./BackButton";
|
|
import { Controls } from "./Controls";
|
|
import { mapSeasonAndEpisodeNumberToText } from "./utils";
|
|
|
|
export const Header = () => {
|
|
const isIdle = usePlayerStore((state) => state.interface.isIdle);
|
|
const meta = usePlayerStore((state) => state.meta);
|
|
|
|
if (!isIdle) {
|
|
return (
|
|
<View
|
|
zIndex={50}
|
|
flexDirection="row"
|
|
alignItems="center"
|
|
justifyContent="space-between"
|
|
height={64}
|
|
paddingHorizontal="$8"
|
|
>
|
|
<View width={150}>
|
|
<Controls>
|
|
<BackButton />
|
|
</Controls>
|
|
</View>
|
|
{meta && (
|
|
<Text fontWeight="bold">
|
|
{meta.title} ({meta.releaseYear}){" "}
|
|
{meta.season !== undefined && meta.episode !== undefined
|
|
? mapSeasonAndEpisodeNumberToText(
|
|
meta.season.number,
|
|
meta.episode.number,
|
|
)
|
|
: ""}
|
|
</Text>
|
|
)}
|
|
<View alignItems="center" justifyContent="center" width={150}>
|
|
<BrandPill />
|
|
</View>
|
|
</View>
|
|
);
|
|
}
|
|
};
|