2022-07-13 23:23:03 +00:00
|
|
|
import clsx from 'clsx'
|
|
|
|
import { ReactNode } from 'react'
|
|
|
|
|
|
|
|
export function PillButton(props: {
|
|
|
|
selected: boolean
|
|
|
|
onSelect: () => void
|
|
|
|
color?: string
|
|
|
|
big?: boolean
|
|
|
|
children: ReactNode
|
|
|
|
}) {
|
|
|
|
const { children, selected, onSelect, color, big } = props
|
|
|
|
|
|
|
|
return (
|
|
|
|
<button
|
|
|
|
className={clsx(
|
2022-07-19 23:22:55 +00:00
|
|
|
'cursor-pointer select-none whitespace-nowrap rounded-full',
|
2022-07-13 23:23:03 +00:00
|
|
|
selected
|
2022-07-30 07:50:03 +00:00
|
|
|
? ['text-white', color ?? 'bg-greyscale-6']
|
|
|
|
: 'bg-greyscale-2 hover:bg-greyscale-3',
|
2022-07-13 23:23:03 +00:00
|
|
|
big ? 'px-8 py-2' : 'px-3 py-1.5 text-sm'
|
|
|
|
)}
|
|
|
|
onClick={onSelect}
|
|
|
|
>
|
|
|
|
{children}
|
|
|
|
</button>
|
|
|
|
)
|
|
|
|
}
|