{React.cloneElement(addButton, {
label,
source,
disableAdd,
template,
onClick:
addButton?.type !== TableCreateButton
? handleAddButtonClick((props?.addButton as any)?.props?.onClick)
: undefined,
inset
})}
{/** @ts-ignore */}
{Children.map(children, (input: ReactElement, index) => {
if (input.type === EditButton) {
return null;
}
if (!React.isValidElement(input)) {
return null;
}
const columnText = (
{translateLabel({ ...input.props, resource })}
);
return (
{input.props.title ? (
// @ts-ignore
{columnText}
) : (
columnText
)}
);
})}
{!disableRemove && showClearAllButton ? (
) : (
)}
{fields.length === 0 && (
React.isValidElement(child) && child.type === EditButton
).length +
(disableRemove ? 0 : 1)
}
align="center"
>
{empty ? (
empty
) : (
-
)}
)}
{fields.length > 0 &&
fields.map((member: any, index: number) => (
{children}
))}