if a field is nullable, provide a means of specifying null

This commit is contained in:
Greg Saab 2025-10-08 12:22:47 -04:00
commit 3fd0feb75a

View file

@ -151,15 +151,39 @@ const ToolsTab = ({
const required = isPropertyRequired(key, inputSchema);
return (
<div key={key}>
<Label
htmlFor={key}
className="block text-sm font-medium text-gray-700 dark:text-gray-300"
>
{key}
{required && (
<span className="text-red-500 ml-1">*</span>
)}
</Label>
<div className="flex justify-between">
<Label
htmlFor={key}
className="block text-sm font-medium text-gray-700 dark:text-gray-300"
>
{key}
{required && (
<span className="text-red-500 ml-1">*</span>
)}
</Label>
{prop.nullable ? (
<div className="flex items-center space-x-2">
<Checkbox
id={key}
name={key}
checked={params[key] === null}
onCheckedChange={(checked: boolean) =>
setParams({
...params,
[key]: checked ? null : prop.default,
})
}
/>
<label
htmlFor={key}
className="text-sm font-medium text-gray-700 dark:text-gray-300"
>
Null
</label>
</div>
) : null}
</div>
{prop.type === "boolean" ? (
<div className="flex items-center space-x-2 mt-2">
<Checkbox