Debian Codegraph @

node/@patternfly/react-table/src/components/Table/examples/TableEmptyState.tsx

raw
1 import { Table, Thead, Tr, Th, Tbody, Td } from '@patternfly/react-table';
2 import {
3 Bullseye,
4 EmptyState,
5 EmptyStateVariant,
6 EmptyStateBody,
7 Button,
8 EmptyStateFooter,
9 EmptyStateActions
10 } from '@patternfly/react-core';
11 import SearchIcon from '@patternfly/react-icons/dist/esm/icons/search-icon';
12
13 // This example has been simplified to focus on the empty state. In real usage,
14 // you may want to derive your rows from typed underlying data and minimal state. See other examples.
15
16 export const TableEmptyState: React.FunctionComponent = () => (
17 <Table aria-label="Empty state table">
18 <Thead>
19 <Tr>
20 <Th>Repositories</Th>
21 <Th>Branches</Th>
22 <Th>Pull requests</Th>
23 <Th>Workspaces</Th>
24 <Th>Last commit</Th>
25 </Tr>
26 </Thead>
27 <Tbody>
28 <Tr>
29 <Td colSpan={8}>
30 <Bullseye>
31 <EmptyState headingLevel="h2" titleText="No results found" icon={SearchIcon} variant={EmptyStateVariant.sm}>
32 <EmptyStateBody>Clear all filters and try again.</EmptyStateBody>
33 <EmptyStateFooter>
34 <EmptyStateActions>
35 <Button variant="link">Clear all filters</Button>
36 </EmptyStateActions>
37 </EmptyStateFooter>
38 </EmptyState>
39 </Bullseye>
40 </Td>
41 </Tr>
42 </Tbody>
43 </Table>
44 );