"use client"; import Link from "next/link"; import { Badge } from "@/components/ui/badge"; import { Button } from "@/components/ui/button"; import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar"; import { cn, getInitials, formatRelativeDate } from "@/lib/utils"; import { ArrowUpRight, Clock, CheckCircle2, AlertCircle, Film, MessageSquare, } from "lucide-react"; import type { ShotWithDetails } from "@/types"; interface ShotQueueProps { shots: ShotWithDetails[]; projectId?: string; title?: string; } const STATUS_STYLES: Record = { WAITING: "text-zinc-400", IN_PROGRESS: "text-blue-400", IN_REVIEW: "text-purple-400", REVISIONS: "text-orange-400", COMPLETE: "text-emerald-400", }; const STATUS_ICONS: Record = { WAITING: Clock, IN_PROGRESS: Film, IN_REVIEW: AlertCircle, REVISIONS: AlertCircle, COMPLETE: CheckCircle2, }; const PRIORITY_DOT: Record = { LOW: "bg-zinc-500", NORMAL: "bg-blue-500", HIGH: "bg-amber-500", URGENT: "bg-red-500", }; export function ShotQueue({ shots, projectId, title = "Shot Queue" }: ShotQueueProps) { if (shots.length === 0) { return (

No shots yet

); } return (
{shots.map((shot) => { const StatusIcon = STATUS_ICONS[shot.status] ?? Clock; const latestVersion = shot.versions?.[0]; const openComments = shot.versions ?.reduce((sum, v) => sum + (v._count?.comments ?? 0), 0) ?? 0; const href = projectId ? `/projects/${projectId}/shots/${shot.id}` : `/projects/${(shot as any).projectId ?? "#"}/shots/${shot.id}`; return (
{/* Priority dot */}
{/* Shot code */} {shot.shotCode} {/* Description / name */} {shot.description ?? shot.shotCode} {/* Open comments */} {openComments > 0 && ( {openComments} )} {/* Status */} {shot.status.replace("_", " ")} {/* Artist */} {shot.artist && ( {shot.artist.image && } {getInitials(shot.artist.name)} )} {/* Open link */}
); })}
); }