diff --git a/src/components/Table/Table.tsx b/src/components/Table/Table.tsx
index 030d10c73..5798380f6 100644
--- a/src/components/Table/Table.tsx
+++ b/src/components/Table/Table.tsx
@@ -1,7 +1,6 @@
import type { LunaticComponentProps } from '../type';
import { LunaticComponents } from '../LunaticComponents';
import { getComponentErrors } from '../shared/ComponentErrors/ComponentErrors';
-import { Label } from '../shared/Label/Label';
import {
Td,
Tbody,
@@ -9,48 +8,41 @@ import {
TableHeader,
Table as BaseTable,
} from '../shared/Table';
-import { Declarations } from '../shared/Declarations/Declarations';
import type { PropsWithChildren } from 'react';
export function Table(props: LunaticComponentProps<'Table'>) {
- const { id, body, header, errors, label, declarations } = props;
- const labelId = `label-${id}`;
+ const { id, body, header, errors, declarations, label } = props;
return (
- <>
-
-
-
-
-
- {body.map((row, rowIndex) => (
-
-
- >
- components={row}
- wrapper={({ colspan, rowspan, ...props }) => (
- |
- )}
- />
-
- ))}
-
-
- >
+
+
+
+ {body.map((row, rowIndex) => (
+
+
+ >
+ components={row}
+ wrapper={({ colspan, rowspan, ...props }) => (
+ |
+ )}
+ />
+
+ ))}
+
+
);
}
diff --git a/src/components/shared/Table/Table.tsx b/src/components/shared/Table/Table.tsx
index f1574e229..c6c66aa06 100644
--- a/src/components/shared/Table/Table.tsx
+++ b/src/components/shared/Table/Table.tsx
@@ -3,20 +3,41 @@ import classnames from 'classnames';
import { slottableComponent } from '../HOC/slottableComponent';
import type { LunaticError } from '../../../use-lunatic/type';
import { ComponentErrors } from '../ComponentErrors/ComponentErrors';
+import type { LunaticComponentProps } from '../../type';
+import { Label } from '../Label/Label';
+import { Declarations } from '../Declarations/Declarations';
-type Props = PropsWithChildren<{
- className?: string;
- id?: string;
- errors?: LunaticError[];
-}>;
+type Props = PropsWithChildren<
+ Pick<
+ LunaticComponentProps<'Table'>,
+ 'className' | 'id' | 'label' | 'declarations'
+ > & {
+ errors?: LunaticError[];
+ }
+>;
+
+function LunaticTable({
+ id,
+ className,
+ children,
+ errors,
+ declarations,
+ label,
+}: Props) {
+ const tableId = `table-${id}`;
+ const labelId = `label-${id}`;
-function LunaticTable({ id, className, children, errors }: Props) {
return (
<>
-