forked from rajun/ar-test
27 lines
973 B
TypeScript
27 lines
973 B
TypeScript
import type { ReactNode } from 'react';
|
|
import type { LucideIcon } from 'lucide-react';
|
|
import { IconTile } from '~/components/ui/icon-tile';
|
|
import { Text } from '~/components/ui/text';
|
|
|
|
export interface IconMessageProps {
|
|
icon?: LucideIcon;
|
|
title: string;
|
|
message?: string;
|
|
action?: ReactNode;
|
|
size?: 'md' | 'lg';
|
|
}
|
|
|
|
export function IconMessage({ icon, title, message, action, size = 'md' }: IconMessageProps) {
|
|
const large = size === 'lg';
|
|
return (
|
|
<div className='flex flex-col items-center gap-2 text-center'>
|
|
{icon && <IconTile icon={icon} tone={large ? 'neutral' : 'primary'} size={large ? 'xl' : 'lg'} className='mb-2' />}
|
|
<Text as={large ? 'h1' : 'h3'} variant={large ? 'title' : 'heading'}>
|
|
{title}
|
|
</Text>
|
|
{message && <Text tone='subtle' className='max-w-sm'>{message}</Text>}
|
|
{action && <div className='mt-4'>{action}</div>}
|
|
</div>
|
|
);
|
|
}
|