11'use client' ;
22
33import { FC , useActionState , useState } from 'react' ;
4+ import classNames from 'classnames' ;
45import {
56 TextInput ,
67 HintText ,
@@ -90,6 +91,12 @@ export const LetterTemplateForm: FC<
9091 }
9192 } ;
9293
94+ const formGroupClasses = [
95+ 'nhsuk-u-margin-bottom-6' ,
96+ 'nhsuk-u-padding-top-2' ,
97+ 'nhsuk-u-padding-bottom-2' ,
98+ ] ;
99+
93100 return (
94101 < >
95102 < BackLink href = { `${ getBasePath ( ) } /choose-a-template-type` } >
@@ -110,13 +117,19 @@ export const LetterTemplateForm: FC<
110117 < h1 className = 'nhsuk-heading-xl' data-testid = 'page-heading' >
111118 { pageHeading }
112119 </ h1 >
113- < div className = { templateNameError && 'nhsuk-form-group--error' } >
120+ < div
121+ className = { classNames (
122+ templateNameError && 'nhsuk-form-group--error' ,
123+ ...formGroupClasses
124+ ) }
125+ >
114126 < Label htmlFor = 'letterTemplateName' size = 's' >
115127 { templateNameLabelText }
116128 </ Label >
117129 < HintText > { templateNameHintText } </ HintText >
118130 < TemplateNameGuidance template = { 'LETTER' } />
119131 < TextInput
132+ formGroupProps = { { className : 'nhsuk-u-margin-bottom-0' } }
120133 id = 'letterTemplateName'
121134 defaultValue = { letterTemplateName }
122135 onChange = { letterTemplateNameHandler }
@@ -125,7 +138,11 @@ export const LetterTemplateForm: FC<
125138 />
126139 </ div >
127140 < Select
141+ formGroupProps = { {
142+ className : classNames ( ...formGroupClasses ) ,
143+ } }
128144 label = { templateTypeLabelText }
145+ labelProps = { { size : 's' } }
129146 hint = { templateTypeHintText }
130147 id = 'letterTemplateLetterType'
131148 defaultValue = { letterTemplateLetterType }
@@ -140,7 +157,11 @@ export const LetterTemplateForm: FC<
140157 ) ) }
141158 </ Select >
142159 < Select
160+ formGroupProps = { {
161+ className : classNames ( ...formGroupClasses ) ,
162+ } }
143163 label = { templateLanguageLabelText }
164+ labelProps = { { size : 's' } }
144165 hint = { templateLanguageHintText }
145166 id = 'letterTemplateLanguage'
146167 defaultValue = { letterTemplateLanguage }
@@ -154,7 +175,12 @@ export const LetterTemplateForm: FC<
154175 </ Select . Option >
155176 ) ) }
156177 </ Select >
157- < div className = { templatePdfError && 'nhsuk-form-group--error' } >
178+ < div
179+ className = { classNames (
180+ templatePdfError && 'nhsuk-form-group--error' ,
181+ ...formGroupClasses
182+ ) }
183+ >
158184 < Label htmlFor = 'letterTemplatePdf' size = 's' >
159185 { templatePdfLabelText }
160186 </ Label >
@@ -175,7 +201,12 @@ export const LetterTemplateForm: FC<
175201 error = { templatePdfError }
176202 />
177203 </ div >
178- < div className = { templateCsvError && 'nhsuk-form-group--error' } >
204+ < div
205+ className = { classNames (
206+ templateCsvError && 'nhsuk-form-group--error' ,
207+ ...formGroupClasses
208+ ) }
209+ >
179210 < Label htmlFor = 'letterTemplateCsv' size = 's' >
180211 { templateCsvLabelText }
181212 </ Label >
0 commit comments