Finish delete button

This commit is contained in:
Regalijan 2024-11-01 03:31:30 -04:00
parent 44089ee019
commit 4b42a173bf
Signed by: regalijan
GPG Key ID: 5D4196DA269EF520

View File

@ -1,7 +1,7 @@
import { import {
Button,
Container, Container,
Heading, Heading,
IconButton,
Link, Link,
Table, Table,
TableCaption, TableCaption,
@ -76,6 +76,7 @@ export default function () {
toast({ toast({
description: `Link ${path} was successfully deleted.`, description: `Link ${path} was successfully deleted.`,
onCloseComplete: location.reload,
status: "success", status: "success",
title: "Deleted", title: "Deleted",
}); });
@ -101,7 +102,23 @@ export default function () {
<Td>{entry.destination}</Td> <Td>{entry.destination}</Td>
<Td>{entry.path}</Td> <Td>{entry.path}</Td>
<Td> <Td>
<Button colorScheme="red">Delete</Button> <IconButton
aria-label="Delete link"
colorScheme="red"
icon={
<svg
xmlns="http://www.w3.org/2000/svg"
width="16"
height="16"
fill="currentColor"
viewBox="0 0 16 16"
>
<path d="M5.5 5.5A.5.5 0 0 1 6 6v6a.5.5 0 0 1-1 0V6a.5.5 0 0 1 .5-.5m2.5 0a.5.5 0 0 1 .5.5v6a.5.5 0 0 1-1 0V6a.5.5 0 0 1 .5-.5m3 .5a.5.5 0 0 0-1 0v6a.5.5 0 0 0 1 0z" />
<path d="M14.5 3a1 1 0 0 1-1 1H13v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V4h-.5a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1H6a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1h3.5a1 1 0 0 1 1 1zM4.118 4 4 4.059V13a1 1 0 0 0 1 1h6a1 1 0 0 0 1-1V4.059L11.882 4zM2.5 3h11V2h-11z" />
</svg>
}
onClick={async () => await deleteLink(entry.path)}
/>
</Td> </Td>
</Tr> </Tr>
); );