Add تنظیمات وبسایت before پیکربندی with landing_* subsections, and show unit addon on numeric setting fields. Co-authored-by: Cursor <cursoragent@cursor.com>
41 lines
2.4 KiB
TypeScript
41 lines
2.4 KiB
TypeScript
export type LandingSection = {
|
|
prefix: string
|
|
title: string
|
|
icon: string
|
|
name: string
|
|
path: string
|
|
}
|
|
|
|
export const LANDING_SETTING_SECTIONS: LandingSection[] = [
|
|
{ prefix: 'landing_site', title: 'تنظیمات کلی سایت', icon: 'vuesax-linear:global', name: 'websiteLandingSite', path: 'site' },
|
|
{ prefix: 'landing_header', title: 'هدر و ناوبری', icon: 'vuesax-linear:menu', name: 'websiteLandingHeader', path: 'header' },
|
|
{ prefix: 'landing_hero', title: 'هیرو', icon: 'vuesax-linear:image', name: 'websiteLandingHero', path: 'hero' },
|
|
{ prefix: 'landing_live_price', title: 'لیبلهای قیمت لحظهای', icon: 'vuesax-linear:chart-2', name: 'websiteLandingLivePrice', path: 'live-price' },
|
|
{ prefix: 'landing_calculator', title: 'عنوان ماشین حساب', icon: 'vuesax-linear:calculator', name: 'websiteLandingCalculator', path: 'calculator' },
|
|
{ prefix: 'landing_feature', title: 'امکانات (چرا نیازی طلا)', icon: 'vuesax-linear:star', name: 'websiteLandingFeature', path: 'feature' },
|
|
{ prefix: 'landing_steps', title: 'مراحل شروع', icon: 'vuesax-linear:ranking', name: 'websiteLandingSteps', path: 'steps' },
|
|
{ prefix: 'landing_trust', title: 'اعتماد و مجوزها', icon: 'vuesax-linear:shield-tick', name: 'websiteLandingTrust', path: 'trust' },
|
|
{ prefix: 'landing_faq', title: 'سوالات متداول', icon: 'vuesax-linear:message-question', name: 'websiteLandingFaq', path: 'faq' },
|
|
{ prefix: 'landing_buttom_cta', title: 'سکشن پایین صفحه لندینگ برای معرفی', icon: 'vuesax-linear:arrow-down', name: 'websiteLandingBottomCta', path: 'bottom-cta' },
|
|
{ prefix: 'landing_footer', title: 'فوتر', icon: 'vuesax-linear:document', name: 'websiteLandingFooter', path: 'footer' }
|
|
]
|
|
|
|
export function matchesLandingPrefix(key: string, prefix: string): boolean {
|
|
return key === prefix || key.startsWith(`${prefix}_`)
|
|
}
|
|
|
|
export function isLandingContentKey(key?: string | null): boolean {
|
|
return String(key ?? '').trim().startsWith('landing_')
|
|
}
|
|
|
|
export function landingSectionByPrefix(prefix: string): LandingSection | undefined {
|
|
return LANDING_SETTING_SECTIONS.find((s) => s.prefix === prefix)
|
|
}
|
|
|
|
export const LANDING_SETTING_GROUPS = LANDING_SETTING_SECTIONS.map((section) => ({
|
|
id: section.prefix,
|
|
title: section.title,
|
|
icon: section.icon,
|
|
match: (key: string) => matchesLandingPrefix(key, section.prefix)
|
|
}))
|