fix(dashboard): controlled Switch for disease status

The disease status Switch used defaultChecked, but row.status loads
async and changes via changeData, triggering MUI's uncontrolled→
controlled warning. Drive it with checked from row.status instead.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
hamed
2026-06-15 22:22:43 +03:30
co-authored by Claude Opus 4.8
parent e7db7c705b
commit a79a6c0629
@@ -56,7 +56,7 @@ function Disease({ data, setData, updateData, loading }) {
<TableCell className="!pr-[18px] dark:!border-transparent !text-[#616161] dark:!text-[#A1A1A1] !text-[16px] !font-medium !text-nowrap">
<TextLoading width={15} height={18} loading={false}>
<Switch
defaultChecked={row.status === "true"}
checked={row.status === "true" || row.status === true}
onChange={(e) => {
changeData(idx, JSON.stringify(e.target.checked));
}}