import React from 'react'; import {css} from '@emotion/core'; import styled from '@emotion/styled'; import classNames from 'classnames'; import Button, {StyledButton} from 'app/components/button'; import space, {ValidSize} from 'app/styles/space'; type ButtonBarProps = { children: React.ReactNode; gap?: ValidSize; merged?: boolean; active?: React.ComponentProps['barId']; className?: string; }; function ButtonBar({ children, className, active, merged = false, gap = 0, }: ButtonBarProps) { const shouldCheckActive = typeof active !== 'undefined'; return ( {!shouldCheckActive ? children : React.Children.map(children, child => { if (!React.isValidElement(child)) { return child; } const {props: childProps, ...childWithoutProps} = child; // We do not want to pass `barId` to