From 74cc1e57ab20a0dc5b81ed38a8429717a678e096 Mon Sep 17 00:00:00 2001 From: Jonathan Date: Wed, 27 Sep 2023 15:53:44 +0200 Subject: [PATCH] ref: roster-for-loop remove row --- .../loop/roster-for-loop/roster-for-loop.tsx | 26 +++++++------------ 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/src/components/loop/roster-for-loop/roster-for-loop.tsx b/src/components/loop/roster-for-loop/roster-for-loop.tsx index b6e44ca3c..f23a4b679 100644 --- a/src/components/loop/roster-for-loop/roster-for-loop.tsx +++ b/src/components/loop/roster-for-loop/roster-for-loop.tsx @@ -31,6 +31,7 @@ export const RosterForLoop = createCustomizableLunaticField< headers, iterations, id, + getComponents, } = props; const min = lines?.min || DEFAULT_MIN_ROWS; const max = lines?.max || DEFAULT_MAX_ROWS; @@ -68,7 +69,15 @@ export const RosterForLoop = createCustomizableLunaticField< {times(nbRows, (n) => ( - + + ({ ...props, ...c, id: `${c.id}-${n}` })} + wrapper={({ id, children }) => ( + {children} + )} + /> + ))} @@ -86,18 +95,3 @@ export const RosterForLoop = createCustomizableLunaticField< ); }, 'RosterforLoop'); - -function Row(props: LunaticComponentProps<'RosterForLoop'> & { row: number }) { - const components = props.getComponents(props.row); - return ( - - ({ ...props, ...c, id: `${c.id}-${props.row}` })} - wrapper={({ id, children }) => ( - {children} - )} - /> - - ); -}