mirror of
https://github.com/Sonny93/my-links.git
synced 2025-12-10 07:25:35 +00:00
feat: recreate admin dashboard using mantine
This commit is contained in:
28
inertia/components/admin/users/th.tsx
Normal file
28
inertia/components/admin/users/th.tsx
Normal file
@@ -0,0 +1,28 @@
|
||||
import { Center, Group, rem, Table, Text, UnstyledButton } from '@mantine/core';
|
||||
import { PropsWithChildren } from 'react';
|
||||
import { TbChevronDown, TbChevronUp, TbSelector } from 'react-icons/tb';
|
||||
import classes from './users_table.module.css';
|
||||
|
||||
interface ThProps extends PropsWithChildren {
|
||||
reversed: boolean;
|
||||
sorted: boolean;
|
||||
onSort(): void;
|
||||
}
|
||||
|
||||
export function Th({ children, reversed, sorted, onSort }: ThProps) {
|
||||
const Icon = sorted ? (reversed ? TbChevronUp : TbChevronDown) : TbSelector;
|
||||
return (
|
||||
<Table.Th className={classes.th}>
|
||||
<UnstyledButton onClick={onSort} className={classes.control}>
|
||||
<Group justify="space-between">
|
||||
<Text fw={500} fz="sm">
|
||||
{children}
|
||||
</Text>
|
||||
<Center className={classes.icon}>
|
||||
<Icon style={{ width: rem(16), height: rem(16) }} />
|
||||
</Center>
|
||||
</Group>
|
||||
</UnstyledButton>
|
||||
</Table.Th>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user