feat(web): page <h1> + document.title on list/form routes (#57)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1,25 +1,34 @@
|
||||
import { useState } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
|
||||
import type { components } from "../api/schema";
|
||||
import { FieldList } from "./field-list";
|
||||
import { FieldForm } from "./field-form";
|
||||
import { useDocumentTitle } from "../lib/use-document-title";
|
||||
import { PageTitle } from "@/components/ui/page-title";
|
||||
|
||||
type FieldDefinitionView = components["schemas"]["FieldDefinitionView"];
|
||||
|
||||
export function FieldsPage() {
|
||||
const { t } = useTranslation();
|
||||
const [selected, setSelected] = useState<FieldDefinitionView | null>(null);
|
||||
|
||||
useDocumentTitle(t("fields.title"));
|
||||
|
||||
return (
|
||||
<div className="grid h-full grid-cols-[20rem_1fr]">
|
||||
<div className="overflow-hidden border-r">
|
||||
<FieldList selectedKey={selected?.key ?? null} onSelect={setSelected} />
|
||||
</div>
|
||||
<div className="overflow-hidden">
|
||||
<FieldForm
|
||||
key={selected?.key ?? "create"}
|
||||
editing={selected}
|
||||
onDone={() => setSelected(null)}
|
||||
/>
|
||||
<div className="flex h-full flex-col">
|
||||
<PageTitle className="px-4 pt-4 pb-2">{t("fields.title")}</PageTitle>
|
||||
<div className="grid flex-1 grid-cols-[20rem_1fr] overflow-hidden">
|
||||
<div className="overflow-hidden border-r">
|
||||
<FieldList selectedKey={selected?.key ?? null} onSelect={setSelected} />
|
||||
</div>
|
||||
<div className="overflow-hidden">
|
||||
<FieldForm
|
||||
key={selected?.key ?? "create"}
|
||||
editing={selected}
|
||||
onDone={() => setSelected(null)}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user