// AK-P4b Interim-UI (AD-28) — Task create preview screen composed from ~/ui. // Presentational: the form posts to the route action (server-driven create); the // loader injects the assignee picker options + optional entity pre-fill. No // useLoaderData / server imports. Final Subframe optics land as a design-nachzug. import { useTranslation } from "react-i18next"; import { FeatherPlus } from "@subframe/core"; import type { TaskPriority } from "@hivegrid/view-models"; import { Breadcrumbs } from "~/ui/components/Breadcrumbs"; import { Button } from "~/ui/components/Button"; import { Card } from "~/ui/components/Card"; import { Select } from "~/ui/components/Select"; import { TextArea } from "~/ui/components/TextArea"; import { TextInput } from "~/ui/components/TextInput"; import { DateField } from "./DateField"; const PRIORITIES: readonly TaskPriority[] = ["low", "normal", "high", "urgent"]; // The ~/ui Select forbids an empty-string option value, so the "creator (default)" // choice uses a sentinel. The route action maps it back to "no explicit assignee". export const TASK_CREATOR_ASSIGNEE = "__creator__"; export type TaskPickerOption = { readonly id: string; readonly label: string }; export type TaskNewPrefill = { readonly entityType: string; readonly entityId: string } | null; export type TaskNewPageProps = { assignableUsers: readonly TaskPickerOption[]; assignableGroups: readonly TaskPickerOption[]; prefill: TaskNewPrefill; /** Back link to the task list (breadcrumb / cancel target). */ cancelHref: string; }; export function TaskNewPage({ assignableUsers, assignableGroups, prefill, cancelHref }: TaskNewPageProps) { const { t } = useTranslation(); return (
); }