Delete modal fixed
This commit is contained in:
parent
8448d8ea95
commit
e4f6aed2f6
3 changed files with 22 additions and 9 deletions
|
|
@ -179,6 +179,7 @@ export default function CollectionCardComponent({
|
||||||
onConfirm={() => {
|
onConfirm={() => {
|
||||||
onDelete();
|
onDelete();
|
||||||
}}
|
}}
|
||||||
|
description={name}
|
||||||
>
|
>
|
||||||
<IconComponent
|
<IconComponent
|
||||||
name="Trash2"
|
name="Trash2"
|
||||||
|
|
@ -239,6 +240,7 @@ export default function CollectionCardComponent({
|
||||||
onConfirm={() => {
|
onConfirm={() => {
|
||||||
onDelete();
|
onDelete();
|
||||||
}}
|
}}
|
||||||
|
description={name}
|
||||||
>
|
>
|
||||||
<Button
|
<Button
|
||||||
variant="ghost"
|
variant="ghost"
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,6 @@ import { Button } from "../../components/ui/button";
|
||||||
import {
|
import {
|
||||||
Dialog,
|
Dialog,
|
||||||
DialogContent,
|
DialogContent,
|
||||||
DialogDescription,
|
|
||||||
DialogFooter,
|
DialogFooter,
|
||||||
DialogHeader,
|
DialogHeader,
|
||||||
DialogTitle,
|
DialogTitle,
|
||||||
|
|
@ -26,22 +25,27 @@ export default function DeleteConfirmationModal({
|
||||||
<DialogContent>
|
<DialogContent>
|
||||||
<DialogHeader>
|
<DialogHeader>
|
||||||
<DialogTitle>
|
<DialogTitle>
|
||||||
<div className="flex">
|
<div className="flex items-center">
|
||||||
Delete <Trash2 className="ml-3 h-4 w-4" strokeWidth={1.5} />
|
<span className="pr-2">Delete</span>
|
||||||
|
<Trash2
|
||||||
|
className="h-6 w-6 pl-1 text-foreground"
|
||||||
|
strokeWidth={1.5}
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</DialogTitle>
|
</DialogTitle>
|
||||||
<DialogDescription>
|
|
||||||
Are you sure you want to delete this {description ?? "component"}?
|
|
||||||
<br></br>
|
|
||||||
This action cannot be undone.
|
|
||||||
</DialogDescription>
|
|
||||||
</DialogHeader>
|
</DialogHeader>
|
||||||
|
<span>
|
||||||
|
Are you sure you want to delete this {description ?? "component"}?
|
||||||
|
<br></br>
|
||||||
|
This action cannot be undone.
|
||||||
|
</span>
|
||||||
<DialogFooter>
|
<DialogFooter>
|
||||||
<DialogClose>
|
<DialogClose>
|
||||||
<Button className="mr-3">Cancel</Button>
|
<Button className="mr-3">Cancel</Button>
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
type="submit"
|
type="submit"
|
||||||
|
variant="destructive"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
onConfirm();
|
onConfirm();
|
||||||
}}
|
}}
|
||||||
|
|
|
||||||
|
|
@ -43,7 +43,14 @@ export default function ComponentsComponent({
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
if (e.dataTransfer.types.some((types) => types === "Files")) {
|
if (e.dataTransfer.types.some((types) => types === "Files")) {
|
||||||
if (e.dataTransfer.files.item(0).type === "application/json") {
|
if (e.dataTransfer.files.item(0).type === "application/json") {
|
||||||
uploadFlow(true, e.dataTransfer.files.item(0)!);
|
try {
|
||||||
|
uploadFlow(true, e.dataTransfer.files.item(0)!);
|
||||||
|
} catch (error: any) {
|
||||||
|
setErrorData({
|
||||||
|
title: "Error uploading file",
|
||||||
|
list: [error.message],
|
||||||
|
});
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
setErrorData({
|
setErrorData({
|
||||||
title: "Invalid file type",
|
title: "Invalid file type",
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue