import { type PolicySection } from './types';
import { CodeBlock } from '@/components/ui/code-block';
type TFn = (key: string) => string;
export function getHowToUseSections(t: TFn): PolicySection[] {
return [
{
value: 'quick-start',
title: t('howToUse.section1.title'),
content: (
{t('howToUse.section1.desc')}
-
{t('howToUse.section1.architecture')}
{t('howToUse.section1.architectureDesc')}
-
{t('howToUse.section1.authSystem')}
{t('howToUse.section1.authSystemDesc')}
-
{t('howToUse.section1.accessToken')}
{t('howToUse.section1.accessTokenDesc')}
-
{t('howToUse.section1.observability')}
{t('howToUse.section1.observabilityDesc')}
),
},
{
value: 'auth-security',
title: t('howToUse.section2.title'),
content: (
{t('howToUse.section2.desc')}
{t('howToUse.section2.passwordAuth')}
-
{t('howToUse.section2.selfRegister')}
{t('howToUse.section2.selfRegisterDesc')}{' '}
bcrypt
{' '}
{t('howToUse.section2.bcryptDesc')}
-
{t('howToUse.section2.switchControl')}
{t('howToUse.section2.switchControlDesc')}
{t('howToUse.section2.oidc')}
{t('howToUse.section2.oidcDesc')}
- {t('howToUse.section2.oidcStep1')}
- {t('howToUse.section2.oidcStep2')}
- {t('howToUse.section2.oidcStep3')}
),
children: [
{ value: '2-1-login', title: t('howToUse.section2.passwordAuth') },
{ value: '2-2-oidc', title: t('howToUse.section2.oidc') },
],
},
{
value: 'access-token',
title: t('howToUse.section3.title'),
content: (
{t('howToUse.section3.desc')}
{t('howToUse.section3.generation')}
-
{t('howToUse.section3.oneTimeDisplay')}
{t('howToUse.section3.oneTimeDisplayDesc')}{' '}
at_xxx
){t('howToUse.section3.oneTimeDisplayHint')}
-
{t('howToUse.section3.secureHash')}
{t('howToUse.section3.secureHashDesc')}
{t('howToUse.section3.headerUsage')}
{t('howToUse.section3.headerUsageDesc')}
{t('howToUse.section3.bearerHeader')}
{t('howToUse.section3.customHeader')}
),
children: [
{ value: '3-1-generation', title: t('howToUse.section3.generation') },
{ value: '3-2-usage', title: t('howToUse.section3.headerUsage') },
],
},
{
value: 'config-system',
title: t('howToUse.section4.title'),
content: (
{t('howToUse.section4.desc')}
-
{t('howToUse.section4.cacheAccel')}
{t('howToUse.section4.cacheAccelDesc')}
-
{t('howToUse.section4.coreConfigs')}
-
site_name
:{t('howToUse.section4.siteName')}
-
password_login_enabled
:{t('howToUse.section4.passwordLoginEnabled')}
-
registration_enabled
:{t('howToUse.section4.registrationEnabled')}
-
max_api_keys_per_user
:{t('howToUse.section4.maxApiKeys')}
),
},
{
value: 'worker-scheduler',
title: t('howToUse.section5.title'),
content: (
{t('howToUse.section5.desc')}
-
{t('howToUse.section5.scheduler')}
{t('howToUse.section5.schedulerDesc')}
-
{t('howToUse.section5.worker')}
{t('howToUse.section5.workerDesc')}
),
},
{
value: 'tracing-metrics',
title: t('howToUse.section6.title'),
content: (
{t('howToUse.section6.desc')}
-
{t('howToUse.section6.tracing')}
{t('howToUse.section6.tracingDesc')}
-
{t('howToUse.section6.structuredLog')}
{t('howToUse.section6.structuredLogDesc')}
),
},
];
}