export const ACTIVITY_TEMPLATE_STATUS_OPTIONS = [
    ["", "全部状态"],
    ["draft", "草稿"],
    ["scheduled", "待开始"],
    ["ongoing", "进行中"],
    ["ended", "已结束"],
    ["disabled", "已停用"],
    ["archived", "已归档"],
];

export const TASK_TYPE_OPTIONS = [
    ["daily_visit", "每日进入活动"],
    ["gift_count", "累计送活动礼物"],
    ["gift_coin_amount", "累计送礼金币"],
];

export const EDITOR_SECTIONS = [
    { key: "basic", label: "基础与投放" },
    { key: "gifts", label: "活动礼物" },
    { key: "tasks", label: "每日任务" },
    { key: "ranking", label: "榜单奖励" },
    { key: "rules", label: "规则文案" },
    { key: "assets", label: "页面素材" },
    { key: "display", label: "展示配置" },
];

export const ASSET_SLOTS = [
    { assetKey: "hero", label: "英语头图", locale: "en" },
    { assetKey: "hero", label: "阿语头图", locale: "ar" },
    { assetKey: "page_background", label: "页面背景", locale: "*" },
    { assetKey: "countdown_background", label: "倒计时背景", locale: "*" },
    { assetKey: "gift_panel_background", label: "礼物区背景", locale: "*" },
    { assetKey: "gift_selected", label: "礼物选中态", locale: "*" },
    { assetKey: "gift_unselected", label: "礼物未选中态", locale: "*" },
    { assetKey: "task_panel_background", label: "任务区背景", locale: "*" },
    { assetKey: "rank_background", label: "榜单背景", locale: "*" },
    { assetKey: "top1_frame", label: "Top1 头像装饰", locale: "*" },
    { assetKey: "top2_frame", label: "Top2 头像装饰", locale: "*" },
    { assetKey: "top3_frame", label: "Top3 头像装饰", locale: "*" },
];

export const DEFAULT_DISPLAY_CONFIG = {
    schema_version: 1,
    default_tab: "tasks",
    countdown: { style: "blocks" },
    gifts: { auto_scroll: true, interval_ms: 3000 },
    leaderboard: { default_board: "daily", page_size: 20, score_display_cap: 999999999, unranked_label: "100+" },
    rtl_locales: ["ar"],
};

export function activityTemplateStatusLabel(value) {
    const status = String(value || "").toLowerCase();
    return ACTIVITY_TEMPLATE_STATUS_OPTIONS.find(([key]) => key === status)?.[1] || status || "-";
}

export function taskTypeLabel(value) {
    return TASK_TYPE_OPTIONS.find(([key]) => key === value)?.[1] || value || "-";
}
