Skip to content

A full-featured CRM built with React, shadcn/ui, and Supabase.

fix typecheck

erwanMarmelabbf5c7963d3dc
diff --git a/src/components/atomic-crm/dataImport/DataImportDialog.tsx b/src/components/atomic-crm/dataImport/DataImportDialog.tsx
index edff17f3..20a56a5d 100644
--- a/src/components/atomic-crm/dataImport/DataImportDialog.tsx
+++ b/src/components/atomic-crm/dataImport/DataImportDialog.tsx
@@ -81,7 +81,7 @@ export function DataImportDialog({
}
}, [importer.state, refresh]);
- const handleResourceChange = (name: string) => {
+ const handleResourceChange = (name: string | null) => {
const next = resources.find((candidate) => candidate.name === name);
if (!next) return;
setFile(null);
diff --git a/src/components/atomic-crm/notes/StatusSelector.tsx b/src/components/atomic-crm/notes/StatusSelector.tsx
index 5694f6ee..a9f2d078 100644
--- a/src/components/atomic-crm/notes/StatusSelector.tsx
+++ b/src/components/atomic-crm/notes/StatusSelector.tsx
@@ -85,8 +85,8 @@ export const StatusSelector = ({
* "No status" needs a selectable item of its own, and an item cannot carry an empty
* value, so it uses a sentinel that is converted back to an empty string on change.
*/
- const handleValueChange = (value: string) => {
- setStatus(value === NONE_VALUE ? "" : value);
+ const handleValueChange = (value: string | null) => {
+ setStatus(!value || value === NONE_VALUE ? "" : value);
};
// <SelectValue> renders the trigger label from this map, not from the items' children.
diff --git a/src/components/atomic-crm/settings/ProfilePage.tsx b/src/components/atomic-crm/settings/ProfilePage.tsx
index be06a590..46283e9a 100644
--- a/src/components/atomic-crm/settings/ProfilePage.tsx
+++ b/src/components/atomic-crm/settings/ProfilePage.tsx
@@ -296,7 +296,11 @@ const LanguageSelector = () => {
<p className="text-xs text-muted-foreground">
{translate("crm.language")}
</p>
- <Select value={locale} onValueChange={setLocale} items={localeItems}>
+ <Select
+ value={locale}
+ onValueChange={(value) => value && setLocale(value)}
+ items={localeItems}
+ >
<SelectTrigger className="w-full">
<SelectValue />
</SelectTrigger>
diff --git a/src/components/atomic-crm/settings/SettingsPageMobile.tsx b/src/components/atomic-crm/settings/SettingsPageMobile.tsx
index 9528b65d..bb641c45 100644
--- a/src/components/atomic-crm/settings/SettingsPageMobile.tsx
+++ b/src/components/atomic-crm/settings/SettingsPageMobile.tsx
@@ -464,7 +464,11 @@ const LanguageRow = () => {
</ItemTitle>
</ItemContent>
<ItemActions>
- <Select value={locale} onValueChange={setLocale} items={localeItems}>
+ <Select
+ value={locale}
+ onValueChange={(value) => value && setLocale(value)}
+ items={localeItems}
+ >
<SelectTrigger
size="sm"
className="w-auto !h-auto py-0 border-none shadow-none"