Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions components/settings/general/form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,24 @@ const Forms: FC<props> = (props) => {
</div>
<div>
<p className="text-sm font-medium text-zinc-900 dark:text-white">Forms</p>
<p className="text-xs text-zinc-500 dark:text-zinc-400">Create, customize, and manage workspace forms for collecting structured data, submissions, and user input across your workspace</p>
<p className="text-xs text-zinc-500 dark:text-zinc-400">Create, customize, and manage workspace forms for collecting structured data, submissions, and user input across your workspace (<strong>Coming Soon</strong>)</p>
</div>
</div>
<SwitchComponenet
{/*<SwitchComponenet
checked={workspace.settings?.policiesEnabled}
label=""
classoverride="mt-0"
/>*/}
<SwitchComponenet
checked={false}
disabled
label=""
classoverride="mt-0"
/>
Comment on lines +34 to 39

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

disabled prop is silently ignored by SwitchComponenet.

The SwitchComponenet in components/switch.tsx destructures disabled but never forwards it to the underlying <Switch>. As a result, the switch still appears interactive (pointer cursor, hover/focus styles) despite the intent to disable it. While the missing onChange prevents state mutation, the UX is misleading — users will think the toggle is clickable.

The fix belongs in components/switch.tsx:

🔧 Forward `disabled` to the underlying `Switch`
 const SwitchComponenet: FC<Props> = ({ disabled, onChange, label, checked }: Props) => {
   return (
     <div className="flex flex-row">
       <Switch
         checked={checked}
+        disabled={disabled}
         className={`${checked ? 'bg-primary' : 'bg-zinc-200'
           } relative inline-flex h-6 w-11 items-center rounded-full shadow-inner mb-2`}
         onChange={onChange}
       >
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@components/settings/general/form.tsx` around lines 34 - 39, The disabled
state is being dropped in `SwitchComponenet`, so the underlying `Switch` still
renders as interactive even when callers pass `disabled`. Update
`components/switch.tsx` inside `SwitchComponenet` to forward the `disabled` prop
directly to the rendered `Switch`, alongside the existing `checked`, `onChange`,
and styling props, so the control reflects its disabled state consistently.

</div>
);
};

Forms.title = "Forms";

export default Forms;
export default Forms;
Loading