Skip to content

Commit

Permalink
Added lang support for radio options
Browse files Browse the repository at this point in the history
  • Loading branch information
adamhaeger committed Nov 22, 2024
1 parent be6be8d commit 9bf1678
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
1 change: 0 additions & 1 deletion src/app-components/table/Table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ export function AppTable({
stickyHeader,
}: DataTableProps) {
const defaultButtonVariant = mobile ? 'secondary' : 'tertiary';

return (
<Table
size={size || 'sm'}
Expand Down
12 changes: 11 additions & 1 deletion src/layout/SimpleTable/SimpleTableComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,17 @@ export function SimpleTableComponent({ node }: TableComponentProps) {
fieldKey={config.accessors[0]}
fieldSchema={itemSchema.properties[config.accessors[0]]}
formData={data[rowIndex]}
component={config.component}
component={
config.component
? {
...config.component,
options: config.component?.options?.map((option) => ({
...option,
label: langAsString(option.label),
})),
}
: undefined
}
handleChange={(fieldName, value) => {
const valueToUpdate = data.find((_, idx) => idx === rowIndex);
const nextValue = { ...valueToUpdate, [`${fieldName}`]: value };
Expand Down

0 comments on commit 9bf1678

Please sign in to comment.