15 lines
409 B
TypeScript
15 lines
409 B
TypeScript
type Props = {
|
|
error?: string | null;
|
|
notice?: string | null;
|
|
};
|
|
|
|
export function Flash({ error = null, notice = null }: Props) {
|
|
if (!error && !notice) return null;
|
|
return (
|
|
<div className="flash" aria-live="polite">
|
|
{error ? <p className="flash__item flash__item--error">{error}</p> : null}
|
|
{notice ? <p className="flash__item flash__item--ok">{notice}</p> : null}
|
|
</div>
|
|
);
|
|
}
|