import clsx from "clsx"; import { Link } from "react-router"; import { useUser } from "~/features/auth/core/user"; import { useSearchParam } from "~/modules/search-params/hooks"; import { SCANNER_PAGE } from "~/utils/urls"; import { SCANNER_TABS, type ScannerTab, scannerSearchParams, } from "../scanner-search-params"; import { FixturesPage } from "./FixturesPage"; import { LivePage } from "./LivePage"; import styles from "./ScannerApp.module.css"; import { ScreenshotPage } from "./ScreenshotPage"; import type { SendouUser } from "./sendou-ingest"; import { VodPage } from "./VodPage"; const TAB_LABELS: Record = { live: "Live", screenshot: "Screenshot", vod: "VoD", fixtures: "Fixtures", }; // the fixtures tab reads the corpus off disk, which only a dev checkout has const visibleTabs = process.env.NODE_ENV === "development" ? SCANNER_TABS : SCANNER_TABS.filter((tab) => tab !== "fixtures"); export function ScannerApp() { const [tab] = useSearchParam(scannerSearchParams, "tab"); const rootUser = useUser(); const sendouUser: SendouUser | null = rootUser ? { id: rootUser.id, username: rootUser.username } : null; const page = tab === "screenshot" ? ( ) : tab === "vod" ? ( ) : tab === "fixtures" && process.env.NODE_ENV === "development" ? ( ) : ( ); return (
{page}
); }