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

22 lines
617 B
TypeScript
Raw Normal View History

2023-07-21 00:09:05 +03:00
interface NavigationTextItemProps {
description?: string | undefined
onClick?: () => void
disabled?: boolean
children: React.ReactNode
}
function DropdownButton({description='', onClick, disabled, children}: NavigationTextItemProps) {
const behavior = (onClick ? 'cursor-pointer clr-hover': 'cursor-default') + ' disabled:cursor-not-allowed';
return (
<button
disabled={disabled}
title={description}
onClick={onClick}
className={`px-3 py-1 text-left overflow-ellipsis ${behavior} whitespace-nowrap`}
>
{children}
</button>
);
}
export default DropdownButton;