import React from 'react'; import clsx from 'clsx'; import { Button } from '../../components/Button/Button'; export interface ButtonConfig { label: string; href?: string; onClick?: (event: React.MouseEvent) => void; } export interface ButtonGroupProps { /** Primary button configuration */ primaryButton?: ButtonConfig; /** Tertiary button configuration */ tertiaryButton?: ButtonConfig; /** Button color theme */ color?: 'green' | 'black'; /** Gap between buttons on tablet+ (0px or 8px) */ gap?: 'none' | 'small'; /** Additional CSS classes */ className?: string; } /** * ButtonGroup Component * * A responsive button group container that displays primary and/or tertiary buttons. * Stacks vertically on mobile and horizontally on tablet+. * * @example * // Basic usage with both buttons * * * @example * // With custom gap * */ export const ButtonGroup: React.FC = ({ primaryButton, tertiaryButton, color = 'green', gap = 'small', className = '', }) => { // Don't render if no buttons are provided if (!primaryButton && !tertiaryButton) { return null; } const classNames = clsx( 'bds-button-group', `bds-button-group--gap-${gap}`, className ); return (
{primaryButton && ( )} {tertiaryButton && ( )}
); }; export default ButtonGroup;