'use client';

import { FcButton } from './FcButton';
import type { ActionType, ButtonBarConfig } from '@/types/invyone-component';

interface FcButtonBarProps {
  config: ButtonBarConfig;
  onAction?: (actionType: ActionType) => void;
}

export function FcButtonBar({ config, onAction }: FcButtonBarProps) {
  return (
    <div className="flex items-center gap-1.5 flex-wrap">
      {config.buttons.map((btn, idx) => (
        <FcButton
          key={`${btn.actionType}-${idx}`}
          config={btn}
          onClick={() => onAction?.(btn.actionType)}
        />
      ))}
    </div>
  );
}
