forked from rajun/ar-test
feat: add icon message
This commit is contained in:
parent
d857bc7990
commit
4d0e3dee9f
26
app/components/ui/icon-message.tsx
Normal file
26
app/components/ui/icon-message.tsx
Normal file
@ -0,0 +1,26 @@
|
||||
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>
|
||||
);
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user