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

18 lines
521 B
TypeScript
Raw Normal View History

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'>
<div className={`absolute ${stretchLeft ? 'right-0' : 'left-0'} mt-2 z-40 flex flex-col items-stretch justify-start origin-top-right border divide-y rounded-md shadow-lg clr-input clr-border ${widthClass}`}>
2023-07-20 17:11:03 +03:00
{children}
</div>
</div>
);
}
2023-07-25 20:27:29 +03:00
export default Dropdown;