mirror of
https://github.com/overleaf/overleaf.git
synced 2024-10-24 21:12:38 -04:00
4138f9707a
Migrate history versions list to Bootstrap 5 GitOrigin-RevId: 4e006ad353cb11eadaefb2df41d2b8591003c664
29 lines
581 B
TypeScript
29 lines
581 B
TypeScript
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 (
|
|
<li className="system-message">
|
|
{id !== 'protected' ? (
|
|
<Close onDismiss={() => setHidden(true)} variant="dark" />
|
|
) : null}
|
|
{children}
|
|
</li>
|
|
)
|
|
}
|
|
|
|
export default SystemMessage
|