ConceptPortal-public/rsconcept/frontend/src/components/ui/Overlay.tsx
Ivan 44b0705521
Some checks are pending
Frontend CI / build (22.x) (push) Waiting to run
R: use alias instead of relative path
2025-01-28 23:23:42 +03:00

36 lines
721 B
TypeScript

import clsx from 'clsx';
import { CProps } from '@/components/props';
interface OverlayProps extends CProps.Styling {
/** Id of the overlay. */
id?: string;
/** Classnames for position of the overlay. */
position?: string;
/** Classname for z-index of the overlay. */
layer?: string;
}
/**
* Displays a transparent overlay over the main content.
*/
function Overlay({
children,
className,
position = 'top-0 right-0',
layer = 'z-pop',
...restProps
}: React.PropsWithChildren<OverlayProps>) {
return (
<div className='relative'>
<div className={clsx('absolute', className, position, layer)} {...restProps}>
{children}
</div>
</div>
);
}
export default Overlay;