1
1
import { isInRange , isNotEmpty , useForm } from "@mantine/form" ;
2
- import { Button , Group , Stack , TimeInput , NumberInput , ActionIcon , IconMinus , Flex } from "@quassel/ui" ;
2
+ import { Button , Group , Stack , TimeInput , NumberInput , ActionIcon , IconMinus } from "@quassel/ui" ;
3
3
import { i18n } from "../../../stores/i18n" ;
4
4
import { useStore } from "@nanostores/react" ;
5
5
import { useEffect } from "react" ;
@@ -18,6 +18,8 @@ type FormValues = {
18
18
19
19
const messages = i18n ( "entityForm" , {
20
20
addDialectAction : "Add dialect" ,
21
+ labelCarer : "Carer" ,
22
+ labelLanguage : "Language" ,
21
23
validationRatio : "Ratio must be between 1 and 100." ,
22
24
validationTotalRatio : "Total Ratio must always be 100%." ,
23
25
validationNotEmpty : "Field must not be empty." ,
@@ -84,13 +86,13 @@ export function EntityForm({ onSave, actionLabel, entry }: EntityFormProps) {
84
86
return (
85
87
< form onSubmit = { f . onSubmit ( onSave ) } >
86
88
< Stack >
87
- < CarerSelect { ...f . getInputProps ( "carerId" ) } />
89
+ < CarerSelect { ...f . getInputProps ( "carerId" ) } placeholder = { t . labelCarer } />
88
90
89
91
{ f . getValues ( ) . languageEntries . map ( ( _ , index ) => (
90
92
// TODO: make key either languageId or name of new language entry
91
93
< Group key = { `entry-${ index } ` } justify = "stretch" >
92
- < NumberInput { ...f . getInputProps ( `languageEntries.${ index } .ratio` ) } max = { 100 } min = { 1 } w = { 80 } />
93
- < LanguageSelect { ...f . getInputProps ( `languageEntries.${ index } .languageId` ) } flex = { 1 } />
94
+ < NumberInput { ...f . getInputProps ( `languageEntries.${ index } .ratio` ) } max = { 100 } min = { 1 } w = { 80 } rightSection = "%" />
95
+ < LanguageSelect { ...f . getInputProps ( `languageEntries.${ index } .languageId` ) } flex = { 1 } placeholder = { t . labelLanguage } />
94
96
{ ! ! index && (
95
97
< ActionIcon
96
98
variant = "light"
0 commit comments