| 1 |
import { Tab } from '@headlessui/react'; |
| 2 |
import { Fragment } from 'react'; |
| 3 |
|
| 4 |
const TabButton = ({ children, disabled }) => { |
| 5 |
return ( |
| 6 |
<Tab as={Fragment}> |
| 7 |
{({ selected }) => ( |
| 8 |
<button |
| 9 |
className={`first:disco-rounded-l-xl last:disco-rounded-r-xl disco-box-border disco-border disco-border-gray-100 disco-pt-3.5 disco-pb-3 disco-flex-grow disco-justify-between disco-outline-none disco-text-base disco-bg-white ${ |
| 10 |
selected |
| 11 |
? 'disco-bg-primary-light !disco-border !disco-bg-primary !disco-border-solid disco-text-white' |
| 12 |
: '' |
| 13 |
} ${ |
| 14 |
!disabled ? 'disco-text-primary' : 'disco-text-gray-400' |
| 15 |
}`} |
| 16 |
> |
| 17 |
{children} |
| 18 |
</button> |
| 19 |
)} |
| 20 |
</Tab> |
| 21 |
); |
| 22 |
}; |
| 23 |
export default TabButton; |
| 24 |
|