Skip to content

Commit

Permalink
fix formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
chunkerchunker authored and SutuSebastian committed Mar 29, 2024
1 parent ca4f841 commit 728aa5a
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions packages/ui/src/components/Button/ButtonGroup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,20 +29,21 @@ const processChildren = (
): ReactNode => {
return Children.map(children as ReactElement<ButtonProps>[], (child, index) => {
if (isValidElement(child)) {
const positionInGroupProp = (child.type == Button) ? { positionInGroup: determinePosition(index, Children.count(children)) } : {};
const positionInGroupProp =
child.type == Button ? { positionInGroup: determinePosition(index, Children.count(children)) } : {};
// Check if the child has nested children
if (child.props.children) {
// Recursively process nested children
return cloneElement(child, {
...child.props,
children: processChildren(child.props.children, outline, pill),
...positionInGroupProp
...positionInGroupProp,
});
} else {
return cloneElement(child, {
outline,
pill,
...positionInGroupProp
...positionInGroupProp,
});
}
}
Expand Down

0 comments on commit 728aa5a

Please sign in to comment.