diff --git a/apps/admin/src/app/(shell)/moderation/[id]/page.tsx b/apps/admin/src/app/(shell)/moderation/[id]/page.tsx new file mode 100644 index 00000000..4ae52aca --- /dev/null +++ b/apps/admin/src/app/(shell)/moderation/[id]/page.tsx @@ -0,0 +1,7 @@ +import { ModerationSheetContainer } from '@/containers/ModerationSheetContainer'; + +/** A-02, the moderation sheet of a route, on its own page. */ +export default async function ModerationSheetPage({ params }: { params: Promise<{ id: string }> }) { + const { id } = await params; + return ; +} diff --git a/apps/admin/src/app/(shell)/moderation/page.tsx b/apps/admin/src/app/(shell)/moderation/page.tsx new file mode 100644 index 00000000..23f881d3 --- /dev/null +++ b/apps/admin/src/app/(shell)/moderation/page.tsx @@ -0,0 +1,11 @@ +import { ModerationQueueContainer } from '@/containers/ModerationQueueContainer'; +import { Suspense } from 'react'; + +/** A-02. The state of the queue is read from the address, in the browser only. */ +export default function ModerationPage() { + return ( + + + + ); +} diff --git a/apps/admin/src/components/confirm/ReasonFields.tsx b/apps/admin/src/components/confirm/ReasonFields.tsx index 3993c03a..a61d3587 100644 --- a/apps/admin/src/components/confirm/ReasonFields.tsx +++ b/apps/admin/src/components/confirm/ReasonFields.tsx @@ -1,7 +1,7 @@ import { messages } from '@/messages/fr'; -import { Field, Select, Textarea } from '@widoo/ui'; +import { Field, RadioGroup, Select, Textarea } from '@widoo/ui'; -export type ReasonOption = { code: string; label: string }; +export type ReasonOption = { code: string; label: string; description?: string }; type ReasonFieldsProps = { /** Prefix of the `id` of the two controls, unique on the page. */ @@ -12,6 +12,17 @@ type ReasonFieldsProps = { onReasonCodeChange: (code: string) => void; detail: string; onDetailChange: (detail: string) => void; + /** Label and help of the detail when it is not a note for the team: a message to an author. */ + detailLabel?: string; + detailHint?: string; + /** Shown instead of the hint when the detail is refused (empty). */ + detailError?: string; + detailPlaceholder?: string; + /** + * `select` (default): a list of the reasons. `radios`: every reason on view with its + * explanation, for the few reasons an author reads (the refusal of a route). + */ + reasonLayout?: 'select' | 'radios'; }; /** @@ -25,31 +36,61 @@ export function ReasonFields({ onReasonCodeChange, detail, onDetailChange, + detailLabel = messages.confirm.detail, + detailHint = messages.confirm.detailHint, + detailError, + detailPlaceholder, + reasonLayout = 'select', }: ReasonFieldsProps) { const texts = messages.confirm; return ( <> - - onReasonCodeChange(event.target.value)} + > + - ))} - - - + {options.map((option) => ( + + ))} + + + )} +