Debian Codegraph @

frontend/js/views/add-child-page/Slug.tsx

raw
1 import React, { SetStateAction } from "react";
2 import { trans } from "../../i18n";
3 import { formatUserLabel } from "../../userLabel";
4 import { SlugInputWidget } from "../../widgets/SlugInputWidget";
5
6 /**
7 * Slug for the new child page.
8 */
9 export default function Slug({
10 id,
11 placeholder,
12 setId,
13 }: {
14 id: string;
15 placeholder: string;
16 setId: (s: SetStateAction<string>) => void;
17 }): JSX.Element {
18 return (
19 <div className="row field-row">
20 <div className="col-md-12">
21 <dl className="field">
22 <dt>{formatUserLabel(trans("ID"))}</dt>
23 <dd>
24 <SlugInputWidget
25 value={id}
26 placeholder={placeholder}
27 onChange={setId}
28 type={{ widget: "slug", name: "slug", size: "normal" }}
29 />
30 </dd>
31 </dl>
32 </div>
33 </div>
34 );
35 }