lty/qy-lty-admin/components/songs/export-cards-dialog.tsx
2026-03-17 13:17:02 +08:00

80 lines
2.6 KiB
TypeScript

"use client"
import { useState } from "react"
import { Button } from "@/components/ui/button"
import {
Dialog,
DialogContent,
DialogDescription,
DialogFooter,
DialogHeader,
DialogTitle,
DialogTrigger,
} from "@/components/ui/dialog"
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select"
import { Label } from "@/components/ui/label"
import { FileDown } from "lucide-react"
interface ExportCardsDialogProps {
songId: string
}
export function ExportCardsDialog({ songId }: ExportCardsDialogProps) {
const [open, setOpen] = useState(false)
const [format, setFormat] = useState("csv")
return (
<Dialog open={open} onOpenChange={setOpen}>
<DialogTrigger asChild>
<Button variant="outline" className="border-purple-200 hover:bg-purple-50 hover:text-purple-700">
<FileDown className="mr-2 h-4 w-4" />
ID
</Button>
</DialogTrigger>
<DialogContent className="sm:max-w-[425px]">
<DialogHeader>
<DialogTitle className="text-xl font-bold bg-clip-text text-transparent bg-gradient-to-r from-purple-600 to-pink-600">
ID
</DialogTitle>
<DialogDescription>
<span className="font-medium">{songId}</span> ID
</DialogDescription>
</DialogHeader>
<div className="grid gap-4 py-4">
<div className="space-y-2">
<Label htmlFor="format"></Label>
<Select value={format} onValueChange={setFormat}>
<SelectTrigger id="format">
<SelectValue placeholder="选择格式" />
</SelectTrigger>
<SelectContent>
<SelectItem value="csv">CSV文件</SelectItem>
<SelectItem value="excel">Excel文件</SelectItem>
<SelectItem value="pdf">PDF文件</SelectItem>
<SelectItem value="json">JSON文件</SelectItem>
</SelectContent>
</Select>
</div>
</div>
<DialogFooter>
<Button variant="outline" onClick={() => setOpen(false)}>
</Button>
<Button
className="bg-gradient-to-r from-purple-500 to-pink-500 hover:from-purple-600 hover:to-pink-600"
onClick={() => {
// 模拟导出操作
setTimeout(() => {
setOpen(false)
}, 1000)
}}
>
<FileDown className="mr-2 h-4 w-4" />
</Button>
</DialogFooter>
</DialogContent>
</Dialog>
)
}