import type { InjectionKey, Ref } from 'vue';
import type { PlayerRow } from '../views/user-form';

export type AgentPlayerActions = {
  canCreatePlayer: boolean;
  openCreatePlayer: (parentAgentUserId: string) => void;
  openDetailPlayer: (id: string) => void;
  openEditPlayer: (id: string) => void;
  openTransfer: (type: 'deposit' | 'withdraw', row: { id: string; username?: string }) => void;
  toggleFreezePlayer: (row: PlayerRow) => void | Promise<void>;
  deletePlayer: (row: PlayerRow) => void | Promise<void>;
  openPlayerWalletLedger: (playerId: string, playerUsername?: string | null) => void;
  playerActionFlags: {
    showEdit: boolean;
    showDeposit: boolean;
    showWithdraw: boolean;
    showFreeze: boolean;
    showDelete: boolean;
  };
};

export const agentPlayerActionsKey: InjectionKey<AgentPlayerActions> = Symbol('agentPlayerActions');
export const agentDirectPlayersReloadKey: InjectionKey<Ref<(() => void) | null>> =
  Symbol('agentDirectPlayersReload');
