import { createRootRoute, Link, Outlet } from "@tanstack/react-router"; import { useEffect, useState } from "react"; import { api } from "~/shared/lib/api"; import { cn } from "~/shared/lib/utils"; declare const __APP_VERSION__: string; export const Route = createRootRoute({ component: RootLayout, }); function NavLink({ to, children, exact = false }: { to: string; children: React.ReactNode; exact?: boolean }) { return ( {children} ); } function VersionBadge() { const [serverVersion, setServerVersion] = useState(null); useEffect(() => { api .get<{ version: string }>("/api/version") .then((d) => setServerVersion(d.version)) .catch(() => {}); }, []); const buildVersion = typeof __APP_VERSION__ !== "undefined" ? __APP_VERSION__ : null; const mismatch = buildVersion && serverVersion && buildVersion !== serverVersion; return ( v{serverVersion ?? buildVersion ?? "?"} {mismatch && ( ⚠ )} ); } function RootLayout() { const isDev = import.meta.env.DEV; return ( {isDev && ( ⚠ DEV MODE — fresh test database, 50 movies + 10 series per scan )} 🎬 netfelix Library Pipeline Subtitles Paths Settings ); } import type React from "react";