fix: use CategoryPicker in AddToThreadModal new-thread create mode
Replaces plain <select> with CategoryPicker for consistency with ManualEntryForm, CreateThreadModal, and other thread creation flows. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -7,6 +7,7 @@ import { useGlobalItem } from "../hooks/useGlobalItems";
|
|||||||
import { useCreateThread, useThreads } from "../hooks/useThreads";
|
import { useCreateThread, useThreads } from "../hooks/useThreads";
|
||||||
import { apiPost } from "../lib/api";
|
import { apiPost } from "../lib/api";
|
||||||
import { useUIStore } from "../stores/uiStore";
|
import { useUIStore } from "../stores/uiStore";
|
||||||
|
import { CategoryPicker } from "./CategoryPicker";
|
||||||
|
|
||||||
export function AddToThreadModal() {
|
export function AddToThreadModal() {
|
||||||
const { t } = useTranslation(["threads", "common"]);
|
const { t } = useTranslation(["threads", "common"]);
|
||||||
@@ -228,26 +229,13 @@ export function AddToThreadModal() {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<label
|
<label className="block text-sm font-medium text-gray-700 mb-1">
|
||||||
htmlFor="new-thread-category"
|
|
||||||
className="block text-sm font-medium text-gray-700 mb-1"
|
|
||||||
>
|
|
||||||
{t("create.category")}
|
{t("create.category")}
|
||||||
</label>
|
</label>
|
||||||
<select
|
<CategoryPicker
|
||||||
id="new-thread-category"
|
value={newThreadCategoryId ?? 0}
|
||||||
value={newThreadCategoryId ?? ""}
|
onChange={setNewThreadCategoryId}
|
||||||
onChange={(e) =>
|
/>
|
||||||
setNewThreadCategoryId(Number(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 bg-white"
|
|
||||||
>
|
|
||||||
{categories?.map((cat) => (
|
|
||||||
<option key={cat.id} value={cat.id}>
|
|
||||||
{cat.name}
|
|
||||||
</option>
|
|
||||||
))}
|
|
||||||
</select>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{activeThreads.length > 0 && (
|
{activeThreads.length > 0 && (
|
||||||
|
|||||||
Reference in New Issue
Block a user