admin_ruspet/src/components/ui/EmptyState.tsx

25 lines
819 B
TypeScript

import { Center, Stack, Text, ThemeIcon } from '@mantine/core'
import { IconInbox, type Icon } from '@tabler/icons-react'
import type { ReactNode } from 'react'
interface Props {
title: string
description?: string
icon?: Icon
action?: ReactNode
}
export function EmptyState({ title, description, icon: Icon = IconInbox, action }: Props) {
return (
<Center py={56}>
<Stack align="center" gap="xs" maw={320} ta="center">
<ThemeIcon variant="light" color="gray" size={44} radius="xl">
<Icon size={22} stroke={1.5} />
</ThemeIcon>
<Text fw={600}>{title}</Text>
{description && <Text size="sm" c="dimmed">{description}</Text>}
{action}
</Stack>
</Center>
)
}