import type { IWebsiteConfig } from "./rpc";
import {EXTRA_DEFAULT, EXTRA_HONGTIXIANYUE, EXTRA_MINGWUZHITANG, EXTRA_ZHISHIHUISHENG, TP3_DEFAULT, TP3_MINGWUZHITANG, TP4_GAINIANXINSHENGHUO, TP4_DEFAULT, TP5_ZHIYUXUNGUANG, TP5_DEFAULT} from './extra.ts'

export function getConfig(Astro: any):IWebsiteConfig
{
    return Astro.locals.template_config;
}

// 取默认的配置
export function getExtra(extraTag: string = '')
{
    if (extraTag == 'HONGTIXIANYUE') {
        return EXTRA_HONGTIXIANYUE;
    } else if (extraTag == 'ZHISHIHUISHENG') {
        return EXTRA_ZHISHIHUISHENG;
    } else if (extraTag == 'MINGWUZHITANG') {
        return EXTRA_MINGWUZHITANG;
    } else if (extraTag === 'TP3_MINGWUZHITANG') {
        return TP3_MINGWUZHITANG
    }

    return EXTRA_DEFAULT;
}

// 取默认的配置
export function getTp3Extra(extraTag: string = '')
{
    if (extraTag === 'TP3_MINGWUZHITANG') {
        return TP3_MINGWUZHITANG
    }

    return TP3_DEFAULT;
}

// 取默认的配置
export function getTp4Extra(extraTag: string = '')
{
    if (extraTag === 'TP4_GAINIANXINSHENGHUO') {
        return TP4_GAINIANXINSHENGHUO
    }

    return TP4_DEFAULT;
}

// 取默认的配置
export function getTp5Extra(extraTag: string = '')
{
    if (extraTag === 'TP5_ZHIYUXUNGUANG') {
        return TP5_ZHIYUXUNGUANG;
    }

    return TP5_DEFAULT;
}