/**
 * Type definitions for UI-related types
 */

import type { Explorer } from "../units/Explorer.js";

/**
 * Character Sheet component props
 */
export interface CharacterSheetProps {
  unitId: string;
  readOnly: boolean; // True during enemy turn or restricted events
}

/**
 * Character Sheet component state
 */
export interface CharacterSheetState {
  unit: Explorer; // The full object
  activeTab: "INVENTORY" | "SKILLS" | "MASTERY";
  selectedSlot: "WEAPON" | "ARMOR" | "RELIC" | "UTILITY" | null;
}

/**
 * Stat tooltip breakdown
 */
export interface StatTooltip {
  label: string; // "Attack"
  total: number; // 15
  breakdown: { source: string; value: number }[]; // [{source: "Base", value: 10}, {source: "Rusty Blade", value: 5}]
}

/**
 * Skill Tree Definition
 */
export interface SkillTreeDefinition {
  id: string;
  nodes: Record<string, SkillNodeDefinition>;
}

/**
 * Skill Node Definition
 */
export interface SkillNodeDefinition {
  id?: string;
  tier: number;
  type: string;
  children: string[];
  data?: Record<string, unknown>;
  req?: number; // Level requirement
  cost?: number; // Skill point cost
  [key: string]: unknown;
}

/**
 * Skill Tree Props
 */
export interface SkillTreeProps {
  /** The Unit object (source of state) */
  unit: Explorer;
  /** The Tree Definition (source of layout) */
  treeDef?: SkillTreeDefinition;
}

/**
 * Skill Node State
 */
export interface SkillNodeState {
  id: string;
  def: SkillNodeDefinition;
  status: "LOCKED" | "AVAILABLE" | "UNLOCKED";
  /** Calculated position for drawing lines */
  domRect?: DOMRect;
}

/**
 * Skill Tree Events
 */
export interface SkillTreeUnlockRequestEvent {
  nodeId: string;
  cost: number;
}
