2023-07-20 17:11:03 +03:00
|
|
|
interface DropdownProps {
|
|
|
|
children: React.ReactNode
|
|
|
|
stretchLeft?: boolean
|
|
|
|
widthClass?: string
|
|
|
|
}
|
|
|
|
|
2023-07-25 20:27:29 +03:00
|
|
|
function Dropdown({ children, widthClass = 'w-fit', stretchLeft }: DropdownProps) {
|
2023-07-20 17:11:03 +03:00
|
|
|
return (
|
2023-08-27 16:35:17 +03:00
|
|
|
<div className='relative text-sm'>
|
2023-09-03 18:26:50 +03:00
|
|
|
<div className={`absolute ${stretchLeft ? 'right-0' : 'left-0'} mt-2 py-1 z-40 flex flex-col items-stretch justify-start origin-top-right border divide-y divide-inherit rounded-md shadow-lg clr-input ${widthClass}`}>
|
2023-07-20 17:11:03 +03:00
|
|
|
{children}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2023-07-25 20:27:29 +03:00
|
|
|
export default Dropdown;
|