const TITLE_KEYS = {
  command: "approval.title.command",
  file_change: "approval.title.fileChange",
  permissions: "approval.title.permissions",
  generic: "approval.title.generic"
};

const STATUS_KEYS = {
  pending: "approval.status.pending",
  approved: "approval.status.approved",
  rejected: "approval.status.rejected",
  expired: "approval.status.expired"
};

export function approvalDisplay(approval, t) {
  const titleKey = TITLE_KEYS[approval.kind];
  const statusKey = STATUS_KEYS[approval.status];
  return {
    title: titleKey ? t(titleKey) : approval.title,
    status: statusKey ? t(statusKey) : approval.status,
    reason: approval.reasonKey ? t(approval.reasonKey) : approval.reason,
    commandPreview: approval.commandPreviewKey
      ? t(approval.commandPreviewKey, approval.commandPreviewValues)
      : approval.commandPreview
  };
}
