Delete modal fixed

This commit is contained in:
Lucas Oliveira 2023-11-21 16:19:34 -03:00
commit e4f6aed2f6
3 changed files with 22 additions and 9 deletions

View file

@ -179,6 +179,7 @@ export default function CollectionCardComponent({
onConfirm={() => {
onDelete();
}}
description={name}
>
<IconComponent
name="Trash2"
@ -239,6 +240,7 @@ export default function CollectionCardComponent({
onConfirm={() => {
onDelete();
}}
description={name}
>
<Button
variant="ghost"

View file

@ -4,7 +4,6 @@ import { Button } from "../../components/ui/button";
import {
Dialog,
DialogContent,
DialogDescription,
DialogFooter,
DialogHeader,
DialogTitle,
@ -26,22 +25,27 @@ export default function DeleteConfirmationModal({
<DialogContent>
<DialogHeader>
<DialogTitle>
<div className="flex">
Delete <Trash2 className="ml-3 h-4 w-4" strokeWidth={1.5} />
<div className="flex items-center">
<span className="pr-2">Delete</span>
<Trash2
className="h-6 w-6 pl-1 text-foreground"
strokeWidth={1.5}
/>
</div>
</DialogTitle>
<DialogDescription>
Are you sure you want to delete this {description ?? "component"}?
<br></br>
This action cannot be undone.
</DialogDescription>
</DialogHeader>
<span>
Are you sure you want to delete this {description ?? "component"}?
<br></br>
This action cannot be undone.
</span>
<DialogFooter>
<DialogClose>
<Button className="mr-3">Cancel</Button>
<Button
type="submit"
variant="destructive"
onClick={() => {
onConfirm();
}}

View file

@ -43,7 +43,14 @@ export default function ComponentsComponent({
e.preventDefault();
if (e.dataTransfer.types.some((types) => types === "Files")) {
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 {
setErrorData({
title: "Invalid file type",