import React from "react"; import { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle, DialogTrigger, } from "@/components/ui/dialog"; import { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle, AlertDialogTrigger, } from "@/components/ui/alert-dialog"; import { X } from "lucide-react"; import { Button } from "./ui/button"; export default function AttachmentsDialog({ children, attachments, deleteFile, deleteAllAttachmentsFiles, }: { children: React.ReactNode; attachments: File[] | []; deleteFile: (file: any) => void; deleteAllAttachmentsFiles: () => void; }) { return ( {children} پیوست‌ها {attachments.length != 0 && ( {" "} )} {attachments.length == 0 ? (
هیج پیوستی وجود ندارد.
) : (
{attachments?.map((item, index) => { return (
{index + 1}

{item.name}

deleteFile(item.name)} className=" cursor-pointer hover:drop-shadow-md" />
); })}
)} آیا میخواهید همه ی فایلها را حذف کنید؟ لغو deleteAllAttachmentsFiles()} > تایید
); }