ConceptPortal-public/rsconcept/frontend/src/components/Common/Dropdown.tsx

39 lines
665 B
TypeScript
Raw Normal View History

import clsx from 'clsx';
import { CProps } from '../props';
import Overlay from './Overlay';
interface DropdownProps
extends CProps.Styling {
2023-07-20 17:11:03 +03:00
stretchLeft?: boolean
children: React.ReactNode
2023-07-20 17:11:03 +03:00
}
function Dropdown({
className,
stretchLeft,
children,
...restProps
}: DropdownProps) {
2023-07-20 17:11:03 +03:00
return (
<Overlay
layer='z-modal-tooltip'
position='mt-3'
className={clsx(
'flex flex-col',
'border rounded-md shadow-lg',
'text-sm',
'clr-input',
{
'right-0': stretchLeft,
'left-0': !stretchLeft
},
className
)}
{...restProps}
>
2023-12-04 14:19:54 +03:00
{children}
</Overlay>);
2023-07-20 17:11:03 +03:00
}
export default Dropdown;