"use client"; import { useState } from "react"; import { Dialog, DialogContent, DialogHeader, DialogTitle, DialogFooter, } from "@/components/ui/dialog"; import { Button } from "@/components/ui/button"; interface CreateChannelDialogProps { open: boolean; onOpenChange: (open: boolean) => void; onSubmit: (data: { name: string; timezone: string; description: string; }) => void; isPending: boolean; error?: string | null; } export function CreateChannelDialog({ open, onOpenChange, onSubmit, isPending, error, }: CreateChannelDialogProps) { const [name, setName] = useState(""); const [timezone, setTimezone] = useState("UTC"); const [description, setDescription] = useState(""); const handleSubmit = (e: React.FormEvent) => { e.preventDefault(); onSubmit({ name, timezone, description }); }; const handleOpenChange = (next: boolean) => { if (!isPending) { onOpenChange(next); if (!next) { setName(""); setTimezone("UTC"); setDescription(""); } } }; return ( New channel
setName(e.target.value)} placeholder="90s Sitcom Network" className="w-full rounded-md border border-zinc-700 bg-zinc-800 px-3 py-2 text-sm text-zinc-100 placeholder:text-zinc-600 focus:border-zinc-500 focus:outline-none" />
setTimezone(e.target.value)} placeholder="America/New_York" className="w-full rounded-md border border-zinc-700 bg-zinc-800 px-3 py-2 text-sm text-zinc-100 placeholder:text-zinc-600 focus:border-zinc-500 focus:outline-none" />

IANA timezone, e.g. America/New_York, Europe/London, UTC