import Close from './close' import usePersistedState from '../hooks/use-persisted-state' type SystemMessageProps = { id: string children: React.ReactNode } function SystemMessage({ id, children }: SystemMessageProps) { const [hidden, setHidden] = usePersistedState( `systemMessage.hide.${id}`, false ) if (hidden) { return null } return (
  • {id !== 'protected' ? ( setHidden(true)} variant="dark" /> ) : null} {children}
  • ) } export default SystemMessage