"use client" import { useState } from "react" import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card" import { Button } from "@/components/ui/button" import { Avatar, AvatarFallback } from "@/components/ui/avatar" import { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle } from "@/components/ui/dialog" import { Badge } from "@/components/ui/badge" import { Copy, Users } from "lucide-react" import { useToast } from "@/hooks/use-toast" interface Judge { id: string name: string specialty: string } interface JudgeListDialogProps { open: boolean onOpenChange: (open: boolean) => void judges: Judge[] } export function JudgeListDialog({ open, onOpenChange, judges }: JudgeListDialogProps) { const { toast } = useToast() const handleCopyJudgeId = async (judgeId: string, judgeName: string) => { try { await navigator.clipboard.writeText(judgeId) toast({ title: "ID已複製", description: `${judgeName}的ID已複製到剪貼簿`, }) } catch (err) { toast({ title: "複製失敗", description: "無法複製ID,請手動複製", variant: "destructive", }) } } return ( 評審清單 當前競賽的評審ID和基本資訊
{judges.map((judge) => (
{/* 左側:頭像和資訊 */}
{judge.name.charAt(0)}

{judge.name}

{judge.specialty}

{/* 右側:ID和複製按鈕 */}
ID: {judge.id}
))}
) }