2022-02-01 17:38:45 +00:00
|
|
|
import { PropsWithChildren } from 'react';
|
2022-09-21 04:49:42 +00:00
|
|
|
import clsx from 'clsx';
|
2022-11-28 02:00:28 +00:00
|
|
|
import { AlertTriangle } from 'lucide-react';
|
2022-02-01 17:38:45 +00:00
|
|
|
|
2022-08-02 23:15:00 +00:00
|
|
|
import { Icon } from '@@/Icon';
|
|
|
|
|
2022-09-21 04:49:42 +00:00
|
|
|
interface Props {
|
|
|
|
className?: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
export function FormError({ children, className }: PropsWithChildren<Props>) {
|
2022-02-01 17:38:45 +00:00
|
|
|
return (
|
2023-06-01 20:35:15 +00:00
|
|
|
<div
|
|
|
|
className={clsx(
|
|
|
|
`text-muted help-block !inline-flex gap-1 !align-top text-xs`,
|
|
|
|
className
|
|
|
|
)}
|
2023-02-22 20:13:33 +00:00
|
|
|
>
|
2023-06-01 20:35:15 +00:00
|
|
|
<Icon
|
|
|
|
icon={AlertTriangle}
|
|
|
|
mode="warning"
|
|
|
|
size="sm"
|
|
|
|
className="flex-none"
|
|
|
|
/>
|
|
|
|
<div className="text-warning">{children}</div>
|
|
|
|
</div>
|
2022-02-01 17:38:45 +00:00
|
|
|
);
|
|
|
|
}
|