import React from "react"; 1; import { Link, Table, Thead, Tbody, Tr, Th, Td, Typography, VisuallyHidden, IconButton, Flex, Pagination, PreviousLink, NextLink, PageLink, Dots, } from "@strapi/design-system"; import { useDeleteHead, useHeads } from "../../lib/queries/head"; import pluginId from "../../pluginId"; import { Pencil } from "@strapi/icons"; import { useRouteMatch } from "react-router-dom"; import { Trash } from "@strapi/icons"; const HeadsTable = () => { const match = useRouteMatch<{ page: string }>( `/settings/${pluginId}/heads/page/:page` ); const pageNumber = parseInt(match?.params.page ?? "1"); const { data: heads } = useHeads(pageNumber); const { mutateAsync: deleteHead } = useDeleteHead(); return ( <> {heads?.results?.map((head: any) => ( ))}
Id Name Head type Actions
{head.id} {head.title} {head.headType} } /> } onClick={() => deleteHead({ id: head.id })} />
{heads && heads.pagination.pageCount > 1 && ( Previous Next )} ); }; export default HeadsTable;