A full-featured CRM built with React, shadcn/ui, and Supabase.
Fix console warnings
François Zaninotto12b1586f92ec
diff --git a/src/components/admin/autocomplete-input.tsx b/src/components/admin/autocomplete-input.tsxindex 5b9b4a79..5da5b1d8 100644--- a/src/components/admin/autocomplete-input.tsx+++ b/src/components/admin/autocomplete-input.tsx@@ -33,10 +33,8 @@ import {useEvent,} from "ra-core";import { InputHelperText } from "./input-helper-text";-import {- SupportCreateSuggestionOptions,- useSupportCreateSuggestion,-} from "@/hooks/useSupportCreateSuggestion";+import type { SupportCreateSuggestionOptions } from "@/hooks/useSupportCreateSuggestion";+import { useSupportCreateSuggestion } from "@/hooks/useSupportCreateSuggestion";/*** Form control that lets users choose a value from a list using a dropdown with autocompletion.diff --git a/src/components/admin/bulk-export-button.tsx b/src/components/admin/bulk-export-button.tsxindex 865cd9f1..8a844a66 100644--- a/src/components/admin/bulk-export-button.tsx+++ b/src/components/admin/bulk-export-button.tsx@@ -1,6 +1,6 @@import { Download } from "lucide-react";-import type { RaRecord } from "ra-core";-import { Translate, useBulkExport, UseBulkExportOptions } from "ra-core";+import type { RaRecord, UseBulkExportOptions } from "ra-core";+import { Translate, useBulkExport } from "ra-core";import { Button } from "../ui/button";diff --git a/src/components/admin/file-field.tsx b/src/components/admin/file-field.tsxindex 2fc34a89..51a0c2a2 100644--- a/src/components/admin/file-field.tsx+++ b/src/components/admin/file-field.tsx@@ -1,4 +1,4 @@-import { HTMLAttributes } from "react";+import type { HTMLAttributes } from "react";import get from "lodash/get";import type { ExtractRecordPaths, HintedString } from "ra-core";import { useFieldValue, useTranslate } from "ra-core";diff --git a/src/components/admin/file-input.tsx b/src/components/admin/file-input.tsxindex 9eba3dc0..cc9f20cf 100644--- a/src/components/admin/file-input.tsx+++ b/src/components/admin/file-input.tsx@@ -14,13 +14,13 @@ import {useInput,useTranslate,} from "ra-core";-import type { DropzoneOptions } from "react-dropzone";-import {- useDropzone,+import type {+ DropzoneOptions,FileRejection,DropEvent,DropzoneInputProps,} from "react-dropzone";+import { useDropzone } from "react-dropzone";import { XCircle } from "lucide-react";import { cn } from "@/lib/utils";diff --git a/src/components/admin/filter-form.tsx b/src/components/admin/filter-form.tsxindex a2de7a03..393c7b11 100644--- a/src/components/admin/filter-form.tsx+++ b/src/components/admin/filter-form.tsx@@ -23,9 +23,9 @@ import {X,} from "lucide-react";import { cn } from "@/lib/utils";+import type { SavedQuery } from "@/hooks/saved-queries";import {extractValidSavedQueries,- SavedQuery,useSavedQueries,} from "@/hooks/saved-queries";import { Button } from "@/components/ui/button";@@ -167,6 +167,9 @@ export const FilterFormInput = (inProps: FilterFormInputProps) => {const { filterElement, handleHide, className } = inProps;const resource = useResourceContext(inProps);const translate = useTranslate();+ const { alwaysOn: _, ...filterElementProps } = filterElement.props;+ const filterElementType =+ typeof filterElement === "string" ? filterElement : filterElement.type;return (<div@@ -176,7 +179,8 @@ export const FilterFormInput = (inProps: FilterFormInputProps) => {className,)}>- {React.cloneElement(filterElement, {+ {React.createElement(filterElementType, {+ ...filterElementProps,resource,record: emptyRecord,size: filterElement.props.size ?? "small",diff --git a/src/components/admin/number-input.tsx b/src/components/admin/number-input.tsxindex cf84718f..ddfdebf7 100644--- a/src/components/admin/number-input.tsx+++ b/src/components/admin/number-input.tsx@@ -39,6 +39,7 @@ export const NumberInput = (props: NumberInputProps) => {format: _formatProp,parse = convertStringToNumber,onFocus,+ helperText,...rest} = props;const resource = useResourceContext({ resource: resourceProp });@@ -99,7 +100,7 @@ export const NumberInput = (props: NumberInputProps) => {onBlur={handleBlur}/></FormControl>- <InputHelperText helperText={props.helperText} />+ <InputHelperText helperText={helperText} /><FormError /></FormField>);diff --git a/src/components/admin/text-input.tsx b/src/components/admin/text-input.tsxindex 5253acd8..9536b5b5 100644--- a/src/components/admin/text-input.tsx+++ b/src/components/admin/text-input.tsx@@ -45,6 +45,7 @@ export const TextInput = (props: TextInputProps) => {multiline,className,inputClassName,+ helperText,validate: _validateProp,format: _formatProp,...rest@@ -70,7 +71,7 @@ export const TextInput = (props: TextInputProps) => {<Input {...rest} {...field} className={inputClassName} />)}</FormControl>- <InputHelperText helperText={props.helperText} />+ <InputHelperText helperText={helperText} /><FormError /></FormField>);diff --git a/src/components/admin/url-field.tsx b/src/components/admin/url-field.tsxindex aa78eac6..b49411fd 100644--- a/src/components/admin/url-field.tsx+++ b/src/components/admin/url-field.tsx@@ -4,7 +4,7 @@ import * as React from "react";import { cn } from "@/lib/utils";import { genericMemo } from "@/lib/genericMemo";-import { FieldProps } from "@/lib/field.type";+import type { FieldProps } from "@/lib/field.type";/*** Displays a URL as a clickable hyperlink.diff --git a/src/components/atomic-crm/companies/CompanyListFilter.tsx b/src/components/atomic-crm/companies/CompanyListFilter.tsxindex 23f98c5c..f5275b00 100644--- a/src/components/atomic-crm/companies/CompanyListFilter.tsx+++ b/src/components/atomic-crm/companies/CompanyListFilter.tsx@@ -25,6 +25,7 @@ export const CompanyListFilter = () => {<ToggleFilterButtonclassName="w-full justify-between"label={size.name}+ key={size.name}value={{ size: size.id }}/>))}@@ -35,6 +36,7 @@ export const CompanyListFilter = () => {<ToggleFilterButtonclassName="w-full justify-between"label={sector.name}+ key={sector.name}value={{ sector: sector.id }}/>))}diff --git a/src/lib/utils.ts b/src/lib/utils.tsindex bd0c391d..a5ef1935 100644--- a/src/lib/utils.ts+++ b/src/lib/utils.ts@@ -1,6 +1,6 @@-import { clsx, type ClassValue } from "clsx"-import { twMerge } from "tailwind-merge"+import { clsx, type ClassValue } from "clsx";+import { twMerge } from "tailwind-merge";export function cn(...inputs: ClassValue[]) {- return twMerge(clsx(inputs))+ return twMerge(clsx(inputs));}