diff --git a/src/routes/protected/pages/pages.tsx b/src/routes/protected/pages/pages.tsx index 9718e70..47e8547 100644 --- a/src/routes/protected/pages/pages.tsx +++ b/src/routes/protected/pages/pages.tsx @@ -6,6 +6,7 @@ import { DownloadIcon, ExclamationTriangleIcon, ReloadIcon, + TrashIcon, } from '@radix-ui/react-icons'; import * as Label from '@radix-ui/react-label'; import * as Select from '@radix-ui/react-select'; @@ -42,6 +43,8 @@ import { updateUrlsProperty, } from '~/services'; import { propertiesLoader } from '../properties/properties'; +import DangerDialog from '~/components/dialogs/danger-dialog'; +import { Button } from '~/components/buttons'; // Initial data on pageload export const pagesLoader = (queryClient: QueryClient) => async () => { @@ -186,7 +189,7 @@ const Pages = () => { }, { accessorKey: 'report', - header: 'Results JSON', + header: 'Results', cell: ({ row }) => row.original?.scans.length > 0 ? ( row.original.scans[getIndexOfNewestScan(row.original.scans)] @@ -227,6 +230,27 @@ const Pages = () => { <> ), }, + { + accessorKey: 'delete', + header: '', + cell: ({ row }) => + {deletePages([row.original.id])}} + triggerButton={ + + } + /> + + + } ], [], ); @@ -336,6 +360,13 @@ const Pages = () => { dataQuery.refetch(); }; + // Delete pages + const deletePages = async (pageIds:Array) => { + console.log(pageIds); + table.resetRowSelection(); + dataQuery.refetch(); + } + return ( <> { + + + { + const urls = table.getSelectedRowModel().flatRows.map((val)=>{return val.original.id}); + deletePages(urls) + }} + triggerButton={ + + } + /> + - - + + + ) : (