export interface QuickAction {
  id: string;
  label: string;
  icon?: string;
  requiresAuth?: boolean;
  priority?: number;
}

export const MAX_VISIBLE_ITEMS = 4;
export const MAX_VISIBLE_LIST = 8;

export function getAvailableActions(
  actions: QuickAction[],
  opts?: { isAuthenticated?: boolean },
): QuickAction[] {
  const isAuthenticated = opts?.isAuthenticated ?? false;
  return actions.filter(
    (a) => !a.requiresAuth || isAuthenticated,
  );
}

export function pickSmartDefault(defaults: QuickAction[]): QuickAction | null {
  if (defaults.length === 0) {
    return null;
  }
  return defaults[0] ?? null;
}
