import React from 'react'; import { CheckboxIcon, InfoIcon, CloseIcon } from '../icons'; interface Props { title?: string | Array; content: string; info?: boolean; success?: boolean; error?: boolean; warning?: boolean; } export function Toast(props: Props) { function getIcon(props: Props) { if (props.info) { return InfoIcon; } else if (props.success) { return CheckboxIcon; } else if (props.error) { return CloseIcon; } else if (props.warning) { return CloseIcon; } else { return CheckboxIcon; } } const { title, content } = props; const Icon = getIcon(props); return ( <>
{title &&

{title}

}

{content}

); }