Skip to content

Commit fa999e4

Browse files
committed
chore: improve indexing list
1 parent 690ffef commit fa999e4

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

apps/frontend/src/components/questionnaire/calendar/EntryForm.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,8 @@ export function EntityForm({ onSave, onDelete, onAddCarer, onAddLanguage, action
9696
<Stack>
9797
<CarerSelect data={carers} {...f.getInputProps("carer")} onAddNew={onAddCarer} placeholder={t.labelCarer} />
9898

99-
{f.getValues().entryLanguages.map((_, index) => (
100-
// TODO: make key either languageId or name of new language entry
101-
<Group key={`entry-${index}`} justify="stretch">
99+
{f.getValues().entryLanguages.map((value, index) => (
100+
<Group key={value.language ? `l-${value.language}` : `i-${index}`} justify="stretch">
102101
<NumberInput {...f.getInputProps(`entryLanguages.${index}.ratio`)} max={100} min={1} w={80} rightSection="%" />
103102
<LanguageSelect
104103
data={languages}

0 commit comments

Comments
 (0)