A full-featured CRM built with React, shadcn/ui, and Supabase.
Chore: Improve import orders and add space between local import and library import
Jonathan ARNAULTbaf37d35f9d1
diff --git a/src/components/atomic-crm/activity/ActivityLogNote.tsx b/src/components/atomic-crm/activity/ActivityLogNote.tsxindex 4f7c862f..57da58d1 100644--- a/src/components/atomic-crm/activity/ActivityLogNote.tsx+++ b/src/components/atomic-crm/activity/ActivityLogNote.tsx@@ -1,7 +1,7 @@-import { Fragment } from "react";+import { Fragment, type ReactNode } from "react";type ActivityLogContactNoteCreatedProps = {- header: React.ReactNode;+ header: ReactNode;text: string;};diff --git a/src/components/atomic-crm/contacts/ContactAside.tsx b/src/components/atomic-crm/contacts/ContactAside.tsxindex ad055c7d..4492b970 100644--- a/src/components/atomic-crm/contacts/ContactAside.tsx+++ b/src/components/atomic-crm/contacts/ContactAside.tsx@@ -1,5 +1,6 @@import { Linkedin, Mail, Phone } from "lucide-react";import { useRecordContext, WithRecord } from "ra-core";+import type { ReactNode } from "react";import {ArrayField,@@ -147,8 +148,8 @@ const PersonalInfoRow = ({primary,showType,}: {- icon: React.ReactNode;- primary: React.ReactNode;+ icon: ReactNode;+ primary: ReactNode;showType?: boolean;}) => (<div className="flex flex-row items-center gap-2 min-h-6">diff --git a/src/components/atomic-crm/contacts/ContactImportDialog.tsx b/src/components/atomic-crm/contacts/ContactImportDialog.tsxindex 07ae7dfb..4bf3be0f 100644--- a/src/components/atomic-crm/contacts/ContactImportDialog.tsx+++ b/src/components/atomic-crm/contacts/ContactImportDialog.tsx@@ -1,7 +1,7 @@import { Loader2 } from "lucide-react";import { Form, useRefresh } from "ra-core";import { Link } from "react-router";-import { useEffect, useState } from "react";+import { type MouseEvent, useEffect, useState } from "react";import { Alert, AlertDescription } from "@/components/ui/alert";import { Button } from "@/components/ui/button";@@ -60,7 +60,7 @@ export function ContactImportDialog({onClose();};- const handleReset = (e: React.MouseEvent<HTMLButtonElement>) => {+ const handleReset = (e: MouseEvent<HTMLButtonElement>) => {e.preventDefault();reset();};diff --git a/src/components/atomic-crm/contacts/ContactInputs.tsx b/src/components/atomic-crm/contacts/ContactInputs.tsxindex c253ac1b..8e077d87 100644--- a/src/components/atomic-crm/contacts/ContactInputs.tsx+++ b/src/components/atomic-crm/contacts/ContactInputs.tsx@@ -1,4 +1,5 @@import { email, required } from "ra-core";+import type { FocusEvent, ClipboardEventHandler } from "react";import { useFormContext } from "react-hook-form";import { Separator } from "@/components/ui/separator";@@ -90,7 +91,7 @@ const ContactPersonalInformationInputs = () => {);};- const handleEmailPaste: React.ClipboardEventHandler<+ const handleEmailPaste: ClipboardEventHandler<HTMLTextAreaElement | HTMLInputElement> = (e) => {const email = e.clipboardData?.getData("text/plain");@@ -98,7 +99,7 @@ const ContactPersonalInformationInputs = () => {};const handleEmailBlur = (- e: React.FocusEvent<HTMLTextAreaElement | HTMLInputElement>,+ e: FocusEvent<HTMLTextAreaElement | HTMLInputElement>,) => {const email = e.target.value;handleEmailChange(email);diff --git a/src/components/atomic-crm/deals/DealEmpty.tsx b/src/components/atomic-crm/deals/DealEmpty.tsxindex c3f621ab..5ba8de59 100644--- a/src/components/atomic-crm/deals/DealEmpty.tsx+++ b/src/components/atomic-crm/deals/DealEmpty.tsx@@ -1,5 +1,6 @@import { useGetList } from "ra-core";import { matchPath, useLocation, Link } from "react-router";+import type { ReactNode } from "react";import { CreateButton } from "@/components/admin";import { Progress } from "@/components/ui/progress";@@ -7,7 +8,7 @@ import useAppBarHeight from "../misc/useAppBarHeight";import type { Contact } from "../types";import { DealCreate } from "./DealCreate";-export const DealEmpty = ({ children }: { children?: React.ReactNode }) => {+export const DealEmpty = ({ children }: { children?: ReactNode }) => {const location = useLocation();const matchCreate = matchPath("/deals/create", location.pathname);const appbarHeight = useAppBarHeight();diff --git a/src/components/atomic-crm/filters/FilterCategory.tsx b/src/components/atomic-crm/filters/FilterCategory.tsxindex 318cef9b..64d6e54f 100644--- a/src/components/atomic-crm/filters/FilterCategory.tsx+++ b/src/components/atomic-crm/filters/FilterCategory.tsx@@ -1,13 +1,14 @@import { Translate } from "ra-core";+import type { ReactNode } from "react";export const FilterCategory = ({icon,label,children,}: {- icon: React.ReactNode;+ icon: ReactNode;label: string;- children?: React.ReactNode;+ children?: ReactNode;}) => (<div className="flex flex-col gap-2"><h3 className="flex flex-row items-center gap-2 font-bold text-sm">diff --git a/src/components/atomic-crm/layout/Layout.tsx b/src/components/atomic-crm/layout/Layout.tsxindex d8303fd1..cde231e5 100644--- a/src/components/atomic-crm/layout/Layout.tsx+++ b/src/components/atomic-crm/layout/Layout.tsx@@ -1,11 +1,11 @@-import { Suspense } from "react";+import { Suspense, type ReactNode } from "react";import { ErrorBoundary } from "react-error-boundary";import { Notification, Error } from "@/components/admin";import { Skeleton } from "@/components/ui/skeleton";import Header from "./Header";-export const Layout = ({ children }: { children: React.ReactNode }) => (+export const Layout = ({ children }: { children: ReactNode }) => (<><Header /><main className="max-w-screen-xl mx-auto pt-4 px-4" id="main-content">diff --git a/src/components/atomic-crm/layout/TopToolbar.tsx b/src/components/atomic-crm/layout/TopToolbar.tsxindex deea67b0..f3b5e4f6 100644--- a/src/components/atomic-crm/layout/TopToolbar.tsx+++ b/src/components/atomic-crm/layout/TopToolbar.tsx@@ -1,7 +1,8 @@import { cn } from "@/lib/utils.ts";+import type { HTMLAttributes, ReactNode } from "react";-export interface TopToolbarProps extends React.HTMLAttributes<HTMLDivElement> {- children?: React.ReactNode;+export interface TopToolbarProps extends HTMLAttributes<HTMLDivElement> {+ children?: ReactNode;}export const TopToolbar = (inProps: TopToolbarProps) => {diff --git a/src/components/atomic-crm/misc/AsideSection.tsx b/src/components/atomic-crm/misc/AsideSection.tsxindex 99f9f231..8d7072e9 100644--- a/src/components/atomic-crm/misc/AsideSection.tsx+++ b/src/components/atomic-crm/misc/AsideSection.tsx@@ -1,9 +1,11 @@+import type { ReactNode } from "react";+import { Separator } from "@/components/ui/separator";import { cn } from "@/lib/utils";export type AsideSectionProps = {title: string;- children?: React.ReactNode;+ children?: ReactNode;noGap?: boolean;};diff --git a/src/components/atomic-crm/notes/NotesIterator.tsx b/src/components/atomic-crm/notes/NotesIterator.tsxindex 4184b7f8..c8bc803f 100644--- a/src/components/atomic-crm/notes/NotesIterator.tsx+++ b/src/components/atomic-crm/notes/NotesIterator.tsx@@ -1,5 +1,5 @@import { useListContext } from "ra-core";-import * as React from "react";+import { Fragment } from "react/jsx-runtime";import { Separator } from "@/components/ui/separator";import { Note } from "./Note";@@ -20,7 +20,7 @@ export const NotesIterator = ({{data && (<div className="mt-4 space-y-4">{data.map((note, index) => (- <React.Fragment key={index}>+ <Fragment key={index}><Notenote={note}isLast={index === data.length - 1}@@ -28,7 +28,7 @@ export const NotesIterator = ({showStatus={showStatus}/>{index < data.length - 1 && <Separator />}- </React.Fragment>+ </Fragment>))}</div>)}diff --git a/src/components/atomic-crm/root/ConfigurationContext.tsx b/src/components/atomic-crm/root/ConfigurationContext.tsxindex 097070ad..d9d201e2 100644--- a/src/components/atomic-crm/root/ConfigurationContext.tsx+++ b/src/components/atomic-crm/root/ConfigurationContext.tsx@@ -1,5 +1,5 @@/* eslint-disable react-refresh/only-export-components */-import { createContext, useContext } from "react";+import { createContext, useContext, type ReactNode } from "react";import type { ContactGender, DealStage, NoteStatus } from "../types";import {@@ -30,7 +30,7 @@ export interface ConfigurationContextValue {}export interface ConfigurationProviderProps extends ConfigurationContextValue {- children: React.ReactNode;+ children: ReactNode;}// Create context with default valuediff --git a/src/components/atomic-crm/simple-list/SimpleList.tsx b/src/components/atomic-crm/simple-list/SimpleList.tsxindex 21409acd..91c50431 100644--- a/src/components/atomic-crm/simple-list/SimpleList.tsx+++ b/src/components/atomic-crm/simple-list/SimpleList.tsx@@ -8,7 +8,7 @@ import {useResourceContext,useTranslate,} from "ra-core";-import { isValidElement } from "react";+import { isValidElement, type ReactElement } from "react";import { ListNoResults } from "./ListNoResults.tsx";import type { FunctionToElement } from "./SimpleListItem.tsx";@@ -128,7 +128,7 @@ export const SimpleList = <RecordType extends RaRecord = any>(export interface SimpleListProps<RecordType extends RaRecord = any>extends SimpleListBaseProps<RecordType> {className?: string;- empty?: React.ReactElement;+ empty?: ReactElement;// can be injected when using the component without contextresource?: string;data?: RecordType[];diff --git a/src/components/atomic-crm/simple-list/SimpleListItem.tsx b/src/components/atomic-crm/simple-list/SimpleListItem.tsxindex e8a3a85e..e0e62b62 100644--- a/src/components/atomic-crm/simple-list/SimpleListItem.tsx+++ b/src/components/atomic-crm/simple-list/SimpleListItem.tsx@@ -1,11 +1,14 @@-import type { Identifier, LinkToType, RaRecord } from "ra-core";import {useEvent,useGetPathForRecord,useGetPathForRecordCallback,useRecordContext,useResourceContext,+ type Identifier,+ type LinkToType,+ type RaRecord,} from "ra-core";+import type { CSSProperties, ReactElement, ReactNode } from "react";import { Link, useNavigate } from "react-router";export const SimpleListItem = <RecordType extends RaRecord = any>(@@ -83,14 +86,14 @@ export const SimpleListItem = <RecordType extends RaRecord = any>(export type FunctionToElement<RecordType extends RaRecord = any> = (record: RecordType,id: Identifier,-) => React.ReactNode;+) => ReactNode;export type FunctionLinkType = (record: RaRecord, id: Identifier) => string;export interface SimpleListBaseProps<RecordType extends RaRecord = any> {leftAvatar?: FunctionToElement<RecordType>;leftIcon?: FunctionToElement<RecordType>;- primaryText?: FunctionToElement<RecordType> | React.ReactElement | string;+ primaryText?: FunctionToElement<RecordType> | ReactElement | string;/*** @deprecated use rowClick instead*/@@ -115,16 +118,16 @@ export interface SimpleListBaseProps<RecordType extends RaRecord = any> {rowClick?: string | RowClickFunction | false;rightAvatar?: FunctionToElement<RecordType>;rightIcon?: FunctionToElement<RecordType>;- secondaryText?: FunctionToElement<RecordType> | React.ReactElement | string;- tertiaryText?: FunctionToElement<RecordType> | React.ReactElement | string;+ secondaryText?: FunctionToElement<RecordType> | ReactElement | string;+ tertiaryText?: FunctionToElement<RecordType> | ReactElement | string;}export interface SimpleListItemProps<RecordType extends RaRecord = any>extends SimpleListBaseProps<RecordType> {rowIndex: number;className?: string;- style?: React.CSSProperties;- children?: React.ReactNode;+ style?: CSSProperties;+ children?: ReactNode;resource?: string;}diff --git a/src/components/atomic-crm/simple-list/SimpleListLoading.tsx b/src/components/atomic-crm/simple-list/SimpleListLoading.tsxindex 9b11dfaf..47f84fe4 100644--- a/src/components/atomic-crm/simple-list/SimpleListLoading.tsx+++ b/src/components/atomic-crm/simple-list/SimpleListLoading.tsx@@ -1,5 +1,6 @@import { useTimeout } from "ra-core";import { ListPlaceholder } from "./ListPlaceholder.tsx";+import type { ReactNode } from "react";export const SimpleListLoading = (props: SimpleListLoadingProps) => {const {@@ -45,7 +46,7 @@ export const SimpleListLoading = (props: SimpleListLoadingProps) => {) : null;};-const times = (nbChildren: number, fn: (key: number) => React.ReactNode) =>+const times = (nbChildren: number, fn: (key: number) => ReactNode) =>Array.from({ length: nbChildren }, (_, key) => fn(key));export interface SimpleListLoadingProps {diff --git a/src/components/atomic-crm/tags/TagDialog.tsx b/src/components/atomic-crm/tags/TagDialog.tsxindex 176d205a..9030cbc1 100644--- a/src/components/atomic-crm/tags/TagDialog.tsx+++ b/src/components/atomic-crm/tags/TagDialog.tsx@@ -1,5 +1,5 @@import { SaveIcon } from "lucide-react";-import { useEffect, useState } from "react";+import { useEffect, useState, type ChangeEvent, type FormEvent } from "react";import { Button, buttonVariants } from "@/components/ui/button";import {@@ -34,9 +34,7 @@ export function TagDialog({const [newTagColor, setNewTagColor] = useState(colors[0]);const [disabled, setDisabled] = useState(false);- const handleNewTagNameChange = (- event: React.ChangeEvent<HTMLInputElement>,- ) => {+ const handleNewTagNameChange = (event: ChangeEvent<HTMLInputElement>) => {setNewTagName(event.target.value);};@@ -45,7 +43,7 @@ export function TagDialog({onClose();};- const handleSubmit = async (event: React.FormEvent<HTMLFormElement>) => {+ const handleSubmit = async (event: FormEvent<HTMLFormElement>) => {event.preventDefault();await onSubmit({ name: newTagName, color: newTagColor });