diff --git a/src/client/routes/threads/$threadId/index.tsx b/src/client/routes/threads/$threadId/index.tsx index d036497..03bd148 100644 --- a/src/client/routes/threads/$threadId/index.tsx +++ b/src/client/routes/threads/$threadId/index.tsx @@ -4,16 +4,12 @@ import { useEffect, useState } from "react"; import { useTranslation } from "react-i18next"; import { CandidateCard } from "../../../components/CandidateCard"; import { CandidateListItem } from "../../../components/CandidateListItem"; -import { CategoryPicker } from "../../../components/CategoryPicker"; import { ComparisonTable } from "../../../components/ComparisonTable"; -import { ImageUpload } from "../../../components/ImageUpload"; import { SetupImpactSelector } from "../../../components/SetupImpactSelector"; import { - useCreateCandidate, useReorderCandidates, useUpdateCandidate, } from "../../../hooks/useCandidates"; -import { useCurrency } from "../../../hooks/useCurrency"; import { useImpactDeltas } from "../../../hooks/useImpactDeltas"; import { useSetup } from "../../../hooks/useSetups"; import { useThread } from "../../../hooks/useThreads"; @@ -32,6 +28,10 @@ function ThreadDetailPage() { const candidateViewMode = useUIStore((s) => s.candidateViewMode); const setCandidateViewMode = useUIStore((s) => s.setCandidateViewMode); const selectedSetupId = useUIStore((s) => s.selectedSetupId); + const openCatalogSearch = useUIStore((s) => s.openCatalogSearch); + const setCatalogSessionThreadId = useUIStore( + (s) => s.setCatalogSessionThreadId, + ); const updateCandidate = useUpdateCandidate(threadId); const reorderMutation = useReorderCandidates(threadId); const { data: setupData } = useSetup(selectedSetupId); @@ -41,8 +41,6 @@ function ThreadDetailPage() { thread?.categoryId ?? 0, ); - const [addCandidateOpen, setAddCandidateOpen] = useState(false); - const [tempItems, setTempItems] = useState< NonNullable["candidates"] | null >(null); @@ -141,7 +139,10 @@ function ThreadDetailPage() { {isActive && ( - - -
- {/* Image */} - - setForm((f) => ({ ...f, imageFilename: filename })) - } - /> - - {/* Name */} -
- - setForm((f) => ({ ...f, name: e.target.value }))} - className="w-full px-3 py-2 border border-gray-200 rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-gray-400 focus:border-transparent" - placeholder={t("threads:candidateForm.namePlaceholder")} - autoFocus - /> - {errors.name && ( -

{errors.name}

- )} -
- - {/* Weight & Price row */} -
-
- - - setForm((f) => ({ - ...f, - weightGrams: e.target.value, - })) - } - className="w-full px-3 py-2 border border-gray-200 rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-gray-400 focus:border-transparent" - placeholder={t("threads:candidateForm.weightPlaceholder")} - /> - {errors.weightGrams && ( -

- {errors.weightGrams} -

- )} -
-
- - - setForm((f) => ({ - ...f, - priceDollars: e.target.value, - })) - } - className="w-full px-3 py-2 border border-gray-200 rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-gray-400 focus:border-transparent" - placeholder={t("threads:candidateForm.pricePlaceholder")} - /> - {errors.priceDollars && ( -

- {errors.priceDollars} -

- )} -
-
- - {/* Category */} -
- - setForm((f) => ({ ...f, categoryId: id }))} - /> -
- - {/* Notes */} -
- -