import { CSSProperties, ReactNode, Component } from "react";
import CloseIcon from '@material-ui/icons/Close';
export function ToastArea(props: {
style?: CSSProperties
children?: ReactNode
}) {
return
{props.children}
}
export class Toast extends Component<{
text?: string
icon?: ReactNode
children?: ReactNode
type?: "normal"|"confirmation"|"error"
style?: CSSProperties
}> {
state = { render: true }
close = () => this.setState({ render: false })
render () {
if (!this.state.render) return null;
return
{
this.props.children ?
this.props.children :
{this.props.icon}
{this.props.text}
}
}
}