11import {
22 type RemixiconComponentType ,
3- RiArrowLeftLine ,
43 RiArrowRightLine ,
54 RiFileCheckLine ,
65 RiShieldKeyholeLine ,
@@ -9,13 +8,13 @@ import {
98import { useEffect , useState } from "react" ;
109import { type IBrowser , type IDevice , UAParser } from "ua-parser-js" ;
1110import type { FormPdfMetadata } from "../../../forms/getFormPdfMetadata" ;
11+ import { formatBrowser } from "../../../utils/formatBrowser" ;
12+ import { formatDevice } from "../../../utils/formatDevice" ;
1213import { formatTimeEstimate } from "../../../utils/formatTimeEstimate" ;
1314import { smartquotes } from "../../../utils/smartquotes" ;
1415import { Button } from "../../common/Button" ;
15- import "./FormTitleStep.css" ;
16- import { formatBrowser } from "../../../utils/formatBrowser" ;
17- import { formatDevice } from "../../../utils/formatDevice" ;
1816import { Heading } from "../../common/Content/Content" ;
17+ import "./FormTitleStep.css" ;
1918
2019const formatter = new Intl . DateTimeFormat ( "en-US" , {
2120 dateStyle : "long" ,
@@ -49,40 +48,14 @@ function FormInfoItem({ icon: Icon, children }: FormInfoItemProps) {
4948}
5049
5150export interface FormTitleStepProps {
52- /**
53- * The title of the form.
54- */
5551 title : string ;
56-
57- /**
58- * The description of the form.
59- */
6052 description ?: string | null ;
61-
62- /**
63- * Child content.
64- */
6553 children ?: React . ReactNode ;
66-
67- /**
68- * Handler for when the user clicks the start button.
69- */
7054 onStart : ( ) => void ;
71-
72- /**
73- * The PDF metadata for forms that will be generated.
74- */
7555 pdfs : FormPdfMetadata [ ] ;
76-
77- /**
78- * The total number of steps in the form.
79- */
8056 totalSteps : number ;
81-
82- /**
83- * The date the form was last updated.
84- */
8557 updatedAt : string ;
58+ headingLevel ?: 1 | 2 | 3 ;
8659}
8760
8861export function FormTitleStep ( {
@@ -93,6 +66,7 @@ export function FormTitleStep({
9366 pdfs,
9467 totalSteps,
9568 updatedAt,
69+ headingLevel = 1 ,
9670} : FormTitleStepProps ) {
9771 const [ device , setDevice ] = useState < IDevice | null > ( null ) ;
9872 const [ browser , setBrowser ] = useState < IBrowser | null > ( null ) ;
@@ -108,10 +82,7 @@ export function FormTitleStep({
10882 return (
10983 < section className = "form-title-step" >
11084 < header className = "form-title-step-header" >
111- < a href = "/forms" className = "form-title-step-back-link" >
112- < RiArrowLeftLine /> All forms
113- </ a >
114- < Heading level = { 1 } className = "form-title-step-heading" >
85+ < Heading level = { headingLevel } className = "form-title-step-heading" >
11586 { smartquotes ( title ) }
11687 </ Heading >
11788 { description && (
0 commit comments