"use client" import { useState } from "react" import type { Dance } from "@/lib/api/types" import { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle, DialogFooter, } from "@/components/ui/dialog" import { Badge } from "@/components/ui/badge" import { Button } from "@/components/ui/button" import { Clock, Music, Calendar, User, BarChart, Video, Play, Pause } from "lucide-react" interface DanceDetailDialogProps { dance: Dance open: boolean onOpenChange: (open: boolean) => void } export function DanceDetailDialog({ dance, open, onOpenChange }: DanceDetailDialogProps) { const [isPlaying, setIsPlaying] = useState(false) const togglePlay = () => { setIsPlaying(!isPlaying) } return ( {dance.name} 舞蹈ID: {dance.id}
{dance.coverUrl ? ( {dance.name} { // 如果图片加载失败,使用占位符 e.currentTarget.src = "/placeholder.svg?height=300&width=400" }} /> ) : (
)}
{isPlaying ? : }
{dance.tags?.map((tag, index) => ( {tag} ))}
编舞者: {dance.choreographer || "未知"}
时长: {dance.duration || "未知"}
难度: {dance.difficulty || "未知"}
分类: {dance.category || "未分类"}
创建时间: {dance.createdAt ? new Date(dance.createdAt).toLocaleDateString() : "未知"}
更新时间: {dance.updatedAt ? new Date(dance.updatedAt).toLocaleDateString() : "未知"}

动作文件:

{dance.motionFile || "未上传动作文件"}

舞蹈描述:

{dance.description || "暂无描述"}
) }