| 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={`disco:first:rounded-l-xl disco:last:rounded-r-xl disco:box-border disco:border disco:border-gray-100 disco:pt-3.5 disco:pb-3 disco:grow disco:justify-between disco:outline-hidden disco:text-base ${ |
| 10 |
selected |
| 11 |
? 'disco:bg-primary disco:border! disco:border-solid! disco:text-white' |
| 12 |
: 'disco:bg-white' |
| 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 |
|