refactor(site): replace double-negation with Boolean() in AgentsPage (#22814)

This commit is contained in:
Danielle Maywood
2026-03-08 17:45:39 +00:00
committed by GitHub
parent c01430e53b
commit 4b3ed61210
2 changed files with 7 additions and 5 deletions
+4 -2
View File
@@ -421,11 +421,13 @@ export const AgentChatInput = memo<AgentChatInputProps>(
// Track whether the editor has content so we can gate the
// send button without a controlled value prop.
const [hasContent, setHasContent] = useState(() => !!initialValue?.trim());
const [hasContent, setHasContent] = useState(() =>
Boolean(initialValue?.trim()),
);
const handleContentChange = useCallback(
(content: string) => {
setHasContent(!!content.trim());
setHasContent(Boolean(content.trim()));
onContentChange?.(content);
},
[onContentChange],
@@ -111,7 +111,7 @@ const InputField: FC<
placeholder={placeholder}
{...fieldProps}
disabled={disabled}
aria-invalid={!!fieldError}
aria-invalid={Boolean(fieldError)}
aria-describedby={fieldError ? errorId : undefined}
/>
{fieldError && (
@@ -171,7 +171,7 @@ const SelectField: FC<
"h-9 min-w-0 text-[13px]",
fieldError && "border-content-destructive",
)}
aria-invalid={!!fieldError}
aria-invalid={Boolean(fieldError)}
aria-describedby={fieldError ? errorId : undefined}
>
<SelectValue placeholder="Unset" />
@@ -235,7 +235,7 @@ const JSONField: FC<
placeholder={placeholder}
{...fieldProps}
disabled={disabled}
aria-invalid={!!fieldError}
aria-invalid={Boolean(fieldError)}
aria-describedby={fieldError ? errorId : undefined}
/>
{fieldError && (