All checks were successful
Build and Publish Docker Image / build-and-push (push) Successful in 50s
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
248 lines
7.1 KiB
TypeScript
248 lines
7.1 KiB
TypeScript
import { useState } from "react";
|
||
import { t } from "@lingui/core/macro";
|
||
import { Trans } from "@lingui/react/macro";
|
||
|
||
import { API_URL } from "../../config/api.ts";
|
||
import { VALIDATION } from "../../../shared/validation.ts";
|
||
import type {
|
||
Category,
|
||
CreateCategoryRequest,
|
||
UpdateCategoryRequest,
|
||
} from "../../../shared/category.ts";
|
||
import type { Wire } from "../../../shared/api.ts";
|
||
import { useAuth } from "../../hooks/auth/useAuth.ts";
|
||
import { useCategories } from "../../hooks/category/useCategories.ts";
|
||
import { ConfirmModal } from "../shared/ConfirmModal.tsx";
|
||
import { expectOk } from "../../utils/shared/api.ts";
|
||
import { FormError } from "../form/FormError.tsx";
|
||
import { FormProvider } from "react-hook-form";
|
||
import { SubmitButton } from "../form/SubmitButton.tsx";
|
||
import { useApiForm } from "../../hooks/form/useApiForm.ts";
|
||
|
||
interface CategoryFields {
|
||
name: string;
|
||
slug: string;
|
||
}
|
||
|
||
/** Sentinel for "the create chip is open" (vs. a category id being edited). */
|
||
const NEW = " |