feat: initialize k-tv-frontend with Next.js and Tailwind CSS
- Added package.json with dependencies and scripts for development, build, and linting. - Created postcss.config.mjs for Tailwind CSS integration. - Added SVG assets for UI components including file, globe, next, vercel, and window icons. - Configured TypeScript with tsconfig.json for strict type checking and module resolution.
This commit is contained in:
59
k-tv-frontend/app/(main)/tv/components/no-signal.tsx
Normal file
59
k-tv-frontend/app/(main)/tv/components/no-signal.tsx
Normal file
@@ -0,0 +1,59 @@
|
||||
import { WifiOff, AlertTriangle, Loader2 } from "lucide-react";
|
||||
|
||||
type NoSignalVariant = "no-signal" | "error" | "loading";
|
||||
|
||||
interface NoSignalProps {
|
||||
variant?: NoSignalVariant;
|
||||
message?: string;
|
||||
}
|
||||
|
||||
const VARIANTS: Record<
|
||||
NoSignalVariant,
|
||||
{ icon: React.ReactNode; heading: string; defaultMessage: string }
|
||||
> = {
|
||||
"no-signal": {
|
||||
icon: <WifiOff className="h-10 w-10 text-zinc-600" />,
|
||||
heading: "No Signal",
|
||||
defaultMessage: "Nothing is scheduled to play right now.",
|
||||
},
|
||||
error: {
|
||||
icon: <AlertTriangle className="h-10 w-10 text-zinc-600" />,
|
||||
heading: "Playback Error",
|
||||
defaultMessage: "Something went wrong. Try switching channels.",
|
||||
},
|
||||
loading: {
|
||||
icon: <Loader2 className="h-10 w-10 animate-spin text-zinc-600" />,
|
||||
heading: "Loading",
|
||||
defaultMessage: "Tuning in…",
|
||||
},
|
||||
};
|
||||
|
||||
export function NoSignal({ variant = "no-signal", message }: NoSignalProps) {
|
||||
const { icon, heading, defaultMessage } = VARIANTS[variant];
|
||||
|
||||
return (
|
||||
<div className="relative flex h-full w-full flex-col items-center justify-center gap-4 bg-zinc-950 select-none overflow-hidden">
|
||||
{/* Static noise texture */}
|
||||
<div
|
||||
aria-hidden
|
||||
className="pointer-events-none absolute inset-0 opacity-[0.03]"
|
||||
style={{
|
||||
backgroundImage:
|
||||
"url(\"data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E\")",
|
||||
backgroundSize: "200px 200px",
|
||||
}}
|
||||
/>
|
||||
|
||||
{icon}
|
||||
|
||||
<div className="flex flex-col items-center gap-1 text-center">
|
||||
<p className="text-sm font-semibold uppercase tracking-widest text-zinc-500">
|
||||
{heading}
|
||||
</p>
|
||||
<p className="max-w-xs text-xs text-zinc-700">{message ?? defaultMessage}</p>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export type { NoSignalProps, NoSignalVariant };
|
||||
Reference in New Issue
Block a user