diff --git a/src/components/ClientCard.tsx b/src/components/ClientCard.tsx index 3c45c6d..2597e98 100644 --- a/src/components/ClientCard.tsx +++ b/src/components/ClientCard.tsx @@ -16,7 +16,7 @@ function ClientCard({ client }: { client: Client }) { Добавьте email

)} - + diff --git a/src/components/SearchInput.tsx b/src/components/SearchInput.tsx index 1284916..33797df 100644 --- a/src/components/SearchInput.tsx +++ b/src/components/SearchInput.tsx @@ -8,7 +8,6 @@ function SearchInput( setSearch: React.Dispatch>; } ) { - // const [value, setValue] = useState(); const ref = useRef(null); return ( diff --git a/src/components/SessionCard.tsx b/src/components/SessionCard.tsx index c940d80..6126647 100644 --- a/src/components/SessionCard.tsx +++ b/src/components/SessionCard.tsx @@ -4,6 +4,7 @@ import SessionModal from "./modals/SessionModal"; function SessionCard({ session }: { session: Session }) { const { setModal, setPosition } = useModalStore(); + return (
) => { + e.preventDefault(); + updateClientData(); + }; + return (
@@ -46,72 +50,70 @@ function ClientModal({ client }: { client: Client }) { Вы можете изменить данные клиента

-
- { - setClientData({ ...clientData, name: e.target.value }); - }} - className="relative" - > - { - navigator.clipboard.writeText(clientData.name); +
+
+ { + setClientData({ ...clientData, name: e.target.value }); }} + className="relative" + required > - - - - { - setClientData({ ...clientData, phone: e.target.value }); - }} - className="relative" - > - { - navigator.clipboard.writeText(clientData.phone); - }} - > - - - - { - setClientData({ ...clientData, email: e.target.value }); - }} - /> -
-
- -
+ + { + setClientData({ ...clientData, phone: e.target.value }); + }} + className="relative" + required + > + { + navigator.clipboard.writeText(clientData.phone); + }} + > + + + + { + setClientData({ ...clientData, email: e.target.value }); + }} + /> +
+
+ +
+
@@ -150,6 +152,9 @@ function ClientModal({ client }: { client: Client }) {
{ + setModal(); + }} >
diff --git a/src/components/modals/SessionModal.tsx b/src/components/modals/SessionModal.tsx index c792691..b666658 100644 --- a/src/components/modals/SessionModal.tsx +++ b/src/components/modals/SessionModal.tsx @@ -10,7 +10,6 @@ import ClientCard from "../ClientCard"; import SessionComments from "../SessionComments"; import { useQuery } from "@tanstack/react-query"; import api from "../../utils/api"; -import { useEffect } from "react"; import SessionFiles from "../SessionFiles"; import DownloadIcon from "../icons/DownloadIcon"; import ShareIcon from "../icons/ShareIcon"; @@ -28,10 +27,6 @@ function SessionModal({ session }: { session: Session }) { .json<{ filename: string; size: number }[]>(), }); - useEffect(() => { - console.log(data); - }, [data]); - return (
@@ -66,7 +61,7 @@ function SessionModal({ session }: { session: Session }) { Интерактивный стол: - {session.server.name} + {session.server?.name}

diff --git a/src/pages/ClientsPage.tsx b/src/pages/ClientsPage.tsx index 81343c0..702f9c5 100644 --- a/src/pages/ClientsPage.tsx +++ b/src/pages/ClientsPage.tsx @@ -1,8 +1,8 @@ import api from "../utils/api"; import Button from "../components/Button"; -import CloseIcon from "../components/icons/CloseIcon"; +// import CloseIcon from "../components/icons/CloseIcon"; import SpinIcon from "../components/icons/SpinIcon"; -import MultySelect from "../components/MultySelect"; +// import MultySelect from "../components/MultySelect"; import SearchInput from "../components/SearchInput"; import { useState } from "react"; import { useQuery } from "@tanstack/react-query"; @@ -52,9 +52,9 @@ function ClientsPage() { enabled: !!me, }); - function reset() { - setSearch(""); - } + // function reset() { + // setSearch(""); + // } return (

@@ -68,7 +68,7 @@ function ClientsPage() { onChange={(e) => setSearch(e.target.value)} setSearch={setSearch} /> -
+ {/*
console.log(1)} /> -
+
*/}

Найдено {count ? pluralize(count, "клиент") : "0 клиентов"}

- + */}
diff --git a/src/types/Client.ts b/src/types/Client.ts index 495f281..acdf129 100644 --- a/src/types/Client.ts +++ b/src/types/Client.ts @@ -1,3 +1,4 @@ +import { Manager } from "./Manager"; import { Session } from "./Session"; export interface Client { @@ -9,4 +10,5 @@ export interface Client { createdAt: string; updatedAt: string; sessions: Session[]; + managers: Manager[]; }