All checks were successful
Build and Publish Docker Image / build-and-push (push) Successful in 2m52s
244 lines
6.8 KiB
TypeScript
244 lines
6.8 KiB
TypeScript
import { useState } from "react";
|
||
import { t } from "@lingui/core/macro";
|
||
import { Trans } from "@lingui/react/macro";
|
||
|
||
import { API_URL, VALIDATION } from "../config/api.ts";
|
||
import {
|
||
type Category,
|
||
type CreateCategoryRequest,
|
||
type RawCategory,
|
||
type UpdateCategoryRequest,
|
||
} from "../model.ts";
|
||
import { useAuth } from "../hooks/useAuth.ts";
|
||
import { useCategories } from "../hooks/useCategories.ts";
|
||
import { ConfirmModal } from "./ConfirmModal.tsx";
|
||
import {
|
||
expectOk,
|
||
FormError,
|
||
FormProvider,
|
||
SubmitButton,
|
||
useApiForm,
|
||
} from "./form/index.ts";
|
||
|
||
interface CategoryFields {
|
||
name: string;
|
||
slug: string;
|
||
}
|
||
|
||
/** Sentinel for "the create chip is open" (vs. a category id being edited). */
|
||
const NEW = " |