import type { ReactNode } from 'react';
import {
Check as CheckIcon,
CircleAlert,
InfoIcon,
Lightbulb,
TriangleAlert,
} from '@/components/icons';
import { Alert, AlertDescription, AlertTitle } from '@/components/ui/alert';
import { styles } from './styles';
import { resolveIcon } from './utils';
export interface CalloutProps {
title?: ReactNode;
icon?: ReactNode | string;
children?: ReactNode;
variant?: 'note' | 'tip' | 'warning' | 'info' | 'check' | 'danger';
}
const CALLOUT_ICONS = {
note: ,
info: ,
warning: ,
tip: ,
check: ,
danger: ,
} as const;
export function Callout({ title, icon, children, variant = 'note' }: CalloutProps) {
return (
{resolveIcon(icon) || CALLOUT_ICONS[variant]}
{title ?
{title} : null}
{children}
);
}
export function Note({ children }: { children?: ReactNode }) {
return {children};
}
export function Tip({ children }: { children?: ReactNode }) {
return {children};
}
export function Warning({ children }: { children?: ReactNode }) {
return {children};
}
export function Info({ children }: { children?: ReactNode }) {
return {children};
}
export function Check({ children }: { children?: ReactNode }) {
return {children};
}
export function Danger({ children }: { children?: ReactNode }) {
return {children};
}
export function WarningBanner({ children }: { children?: ReactNode }) {
return (
}>
{children}
);
}