chore: missing files

feat/support-bool-variable-fe
Joel 7 months ago
parent 18941beb34
commit e1a7b59160

@ -0,0 +1,35 @@
'use client'
import type { FC } from 'react'
import React, { useCallback } from 'react'
import OptionCard from '../../../nodes/_base/components/option-card'
type Props = {
value: boolean
onChange: (value: boolean) => void
}
const BoolValue: FC<Props> = ({
value,
onChange,
}) => {
const handleChange = useCallback((newValue: boolean) => {
return () => {
onChange(newValue)
}
}, [onChange])
return (
<div className='flex w-full space-x-1'>
<OptionCard className='grow'
selected={value}
title='True'
onSelect={handleChange(true)}
/>
<OptionCard className='grow'
selected={!value}
title='False'
onSelect={handleChange(false)}
/>
</div>
)
}
export default React.memo(BoolValue)
Loading…
Cancel
Save