| 1 |
import classNames from 'classnames'; |
| 2 |
import { CheckboxInput } from '@launch/components/CheckboxInput'; |
| 3 |
import { PreviewIcon } from '@launch/svg'; |
| 4 |
|
| 5 |
export const PageSelectButton = ({ |
| 6 |
page, |
| 7 |
previewing, |
| 8 |
onPreview, |
| 9 |
checked, |
| 10 |
onChange, |
| 11 |
forceChecked = false, |
| 12 |
}) => ( |
| 13 |
<div className="flex items-center rounded border border-gray-300"> |
| 14 |
<div |
| 15 |
className={classNames('grow overflow-hidden text-gray-900', { |
| 16 |
'bg-gray-300': forceChecked, |
| 17 |
})}> |
| 18 |
<CheckboxInput |
| 19 |
label={page.name} |
| 20 |
slug={page.slug} |
| 21 |
checked={checked} |
| 22 |
onChange={onChange} |
| 23 |
locked={forceChecked} |
| 24 |
/> |
| 25 |
</div> |
| 26 |
|
| 27 |
<button |
| 28 |
type="button" |
| 29 |
className={classNames( |
| 30 |
'hidden h-full min-h-6 min-w-6 shrink items-center border-l border-gray-300 px-4 py-3 lg:flex', |
| 31 |
{ |
| 32 |
'bg-gray-100 text-gray-800': !previewing, |
| 33 |
'bg-design-main text-white': previewing, |
| 34 |
}, |
| 35 |
)} |
| 36 |
onClick={onPreview}> |
| 37 |
<PreviewIcon className="h-6 w-6" /> |
| 38 |
</button> |
| 39 |
</div> |
| 40 |
); |
| 41 |
|