mirror of
https://github.com/OpenCut-app/OpenCut.git
synced 2026-07-13 21:52:53 +02:00
feat: update delete project dialog
This commit is contained in:
@@ -508,6 +508,7 @@ function ProjectCard({
|
|||||||
isOpen={isDeleteDialogOpen}
|
isOpen={isDeleteDialogOpen}
|
||||||
onOpenChange={setIsDeleteDialogOpen}
|
onOpenChange={setIsDeleteDialogOpen}
|
||||||
onConfirm={handleDeleteProject}
|
onConfirm={handleDeleteProject}
|
||||||
|
projectName={project.name}
|
||||||
/>
|
/>
|
||||||
<RenameProjectDialog
|
<RenameProjectDialog
|
||||||
isOpen={isRenameDialogOpen}
|
isOpen={isRenameDialogOpen}
|
||||||
|
|||||||
@@ -1,53 +1,68 @@
|
|||||||
import { Button } from "@/components/ui/button";
|
import { Button } from "@/components/ui/button";
|
||||||
import {
|
import {
|
||||||
Dialog,
|
Dialog,
|
||||||
DialogContent,
|
DialogContent,
|
||||||
DialogDescription,
|
DialogDescription,
|
||||||
DialogFooter,
|
DialogFooter,
|
||||||
DialogHeader,
|
DialogHeader,
|
||||||
DialogTitle,
|
DialogTitle,
|
||||||
} from "@/components/ui/dialog";
|
} from "@/components/ui/dialog";
|
||||||
|
import { cn } from "@/lib/utils";
|
||||||
export function DeleteProjectDialog({
|
|
||||||
isOpen,
|
export function DeleteProjectDialog({
|
||||||
onOpenChange,
|
isOpen,
|
||||||
onConfirm,
|
onOpenChange,
|
||||||
}: {
|
onConfirm,
|
||||||
isOpen: boolean;
|
projectName,
|
||||||
onOpenChange: (open: boolean) => void;
|
}: {
|
||||||
onConfirm: () => void;
|
isOpen: boolean;
|
||||||
}) {
|
onOpenChange: (open: boolean) => void;
|
||||||
return (
|
onConfirm: () => void;
|
||||||
<Dialog open={isOpen} onOpenChange={onOpenChange}>
|
projectName?: string;
|
||||||
<DialogContent
|
}) {
|
||||||
onOpenAutoFocus={(e) => {
|
return (
|
||||||
e.preventDefault();
|
<Dialog open={isOpen} onOpenChange={onOpenChange}>
|
||||||
e.stopPropagation();
|
<DialogContent
|
||||||
}}
|
onOpenAutoFocus={(e) => {
|
||||||
>
|
e.preventDefault();
|
||||||
<DialogHeader>
|
e.stopPropagation();
|
||||||
<DialogTitle>Delete Project</DialogTitle>
|
}}
|
||||||
<DialogDescription>
|
>
|
||||||
Are you sure you want to delete this project? This action cannot be
|
<DialogHeader>
|
||||||
undone.
|
<DialogTitle>
|
||||||
</DialogDescription>
|
{projectName ? (
|
||||||
</DialogHeader>
|
<>
|
||||||
<DialogFooter>
|
{"Delete '"}
|
||||||
<Button
|
<span className="inline-block max-w-[300px] truncate align-bottom">
|
||||||
variant="outline"
|
{projectName}
|
||||||
onClick={(e) => {
|
</span>
|
||||||
e.preventDefault();
|
{"'?"}
|
||||||
e.stopPropagation();
|
</>
|
||||||
onOpenChange(false);
|
) : (
|
||||||
}}
|
"Delete Project?"
|
||||||
>
|
)}
|
||||||
Cancel
|
</DialogTitle>
|
||||||
</Button>
|
<DialogDescription>
|
||||||
<Button variant="destructive" onClick={onConfirm}>
|
Are you sure you want to delete this project? This action cannot be
|
||||||
Delete
|
undone.
|
||||||
</Button>
|
</DialogDescription>
|
||||||
</DialogFooter>
|
</DialogHeader>
|
||||||
</DialogContent>
|
<DialogFooter>
|
||||||
</Dialog>
|
<Button
|
||||||
);
|
variant="outline"
|
||||||
}
|
onClick={(e) => {
|
||||||
|
e.preventDefault();
|
||||||
|
e.stopPropagation();
|
||||||
|
onOpenChange(false);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
Cancel
|
||||||
|
</Button>
|
||||||
|
<Button variant="destructive" onClick={onConfirm}>
|
||||||
|
Delete
|
||||||
|
</Button>
|
||||||
|
</DialogFooter>
|
||||||
|
</DialogContent>
|
||||||
|
</Dialog>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user