lty/qy-lty-admin/components/outfits/add-print-batch-dialog.tsx
2026-03-17 13:17:02 +08:00

94 lines
3.3 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 { Input } from "@/components/ui/input"
import { Label } from "@/components/ui/label"
import { Plus } from "lucide-react"
interface AddPrintBatchDialogProps {
outfitId: string
isPublished: boolean
}
export function AddPrintBatchDialog({ outfitId, isPublished }: AddPrintBatchDialogProps) {
const [open, setOpen] = useState(false)
const [quantity, setQuantity] = useState(1000)
return (
<Dialog open={open} onOpenChange={setOpen}>
<DialogTrigger asChild>
<Button className="bg-gradient-to-r from-blue-500 to-teal-500 hover:from-blue-600 hover:to-teal-600 transition-all duration-300 shadow-md hover:shadow-lg">
<Plus className="mr-2 h-4 w-4" />
</Button>
</DialogTrigger>
<DialogContent className="sm:max-w-[500px]">
<DialogHeader>
<DialogTitle className="text-xl font-bold bg-clip-text text-transparent bg-gradient-to-r from-blue-600 to-teal-600">
</DialogTitle>
<DialogDescription>
<span className="font-medium">{outfitId}</span> ID
</DialogDescription>
</DialogHeader>
<div className="grid gap-4 py-4">
<div className="space-y-2">
<Label htmlFor="quantity" className="text-right">
</Label>
<Input
id="quantity"
type="number"
min="1"
value={quantity}
onChange={(e) => setQuantity(Number.parseInt(e.target.value))}
className="border-gray-300 focus-visible:ring-blue-500"
/>
<p className="text-sm text-gray-500"> {quantity} ID</p>
</div>
<div className="space-y-2">
<Label className="text-right"></Label>
<div className="p-3 bg-gray-50 rounded-md">
<p className="text-sm text-gray-700">
ID:{" "}
<span className="font-mono">
B
{Math.floor(Math.random() * 1000)
.toString()
.padStart(3, "0")}
</span>
</p>
<p className="text-sm text-gray-700">
ID: <span className="font-mono">{outfitId}-XXXX</span>
</p>
<p className="text-sm text-gray-700">
ID: <span className="font-mono">{outfitId}-YYYY</span>
</p>
</div>
<p className="text-xs text-gray-500">ID将在创建批次时生成</p>
</div>
</div>
<DialogFooter>
<Button variant="outline" onClick={() => setOpen(false)}>
</Button>
<Button className="bg-gradient-to-r from-blue-500 to-teal-500 hover:from-blue-600 hover:to-teal-600">
</Button>
</DialogFooter>
</DialogContent>
</Dialog>
)
}