import React from 'react'; interface IBannerProps { children: JSX.Element | string; className?: string; type: string; open: boolean; setOpen: (value: boolean) => void; } const Banner = ({ type, open, children, className, setOpen, }: IBannerProps): JSX.Element => { const typeIcon = (type: string) => { switch (type) { case 'warning': return ( ); case 'error': return ( ); case 'success': return ( ); default: return ( ); } }; /** * * @param {string} type * @returns {string} */ const typeColor = (type: string): string => { switch (type) { case 'warning': return 'bg-amber-100 border-amber-200 text-amber-600'; case 'error': return 'bg-rose-100 border-rose-200 text-rose-600'; case 'success': return 'bg-emerald-100 border-emerald-200 text-emerald-600'; default: return 'bg-indigo-100 border-indigo-200 text-indigo-500'; } }; return ( <> {open && (