import React from "react";

export type WorkbenchBarSection = "top" | "middle" | "bottom" | "tool-panel";

export type WorkbenchBarAction = () => void;

export interface WorkbenchBarRenderContext {
  id: string;
  disabled: boolean;
  allButtonsDisabled: boolean;
  action?: WorkbenchBarAction;
  triggerAction: () => void;
  active: boolean;
}

export interface WorkbenchBarButtonConfig {
  /** Unique id for the button, also used to bind action callbacks */
  id: string;
  /** Icon element to render when using default renderer */
  icon?: React.ReactNode;
  /** Tooltip content (can be localized node) */
  tooltip?: React.ReactNode;
  /** Optional ARIA label for a11y (separate from visual tooltip) */
  ariaLabel?: string;
  /** Optional i18n key carried by config */
  templateKey?: string;
  /** Visual grouping lane */
  section?: WorkbenchBarSection;
  /** Sorting within a section (lower first); ties broken by id */
  order?: number;
  /** Initial disabled state */
  disabled?: boolean;
  /** Initial visibility */
  visible?: boolean;
  /** Optional custom renderer for advanced layouts */
  render?: (ctx: WorkbenchBarRenderContext) => React.ReactNode;
  /** Optional className applied to wrapper when using default renderer */
  className?: string;
  /** Optional active state to highlight the control */
  active?: boolean;
}
