chore: missing files

This commit is contained in:
Joel 2025-07-04 16:48:56 +08:00
parent 18941beb34
commit e1a7b59160
1 changed files with 35 additions and 0 deletions

View File

@ -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)