mirror of
https://github.com/fleetdm/fleet
synced 2026-05-22 08:28:52 +00:00
24 lines
590 B
TypeScript
24 lines
590 B
TypeScript
import React, { useContext } from "react";
|
|
import { NotificationContext } from "context/notification";
|
|
import FlashMessage from "components/FlashMessage";
|
|
|
|
interface IGatedLayoutProps {
|
|
children: React.ReactNode;
|
|
}
|
|
|
|
const GatedLayout = ({ children }: IGatedLayoutProps): JSX.Element => {
|
|
const { notification, hideFlash } = useContext(NotificationContext);
|
|
|
|
return (
|
|
<div className="gated-layout">
|
|
<FlashMessage
|
|
fullWidth
|
|
notification={notification}
|
|
onRemoveFlash={hideFlash}
|
|
/>
|
|
{children}
|
|
</div>
|
|
);
|
|
};
|
|
|
|
export default GatedLayout;
|