dify/web/app/components/plugins/marketplace/description/index.tsx

46 lines
2.1 KiB
TypeScript
Raw Normal View History

2024-11-06 15:23:38 +08:00
import {
getLocaleOnServer,
useTranslation as translate,
} from '@/i18n/server'
2024-11-06 11:55:19 +08:00
type DescriptionProps = {
locale?: string
}
const Description = async ({
2024-11-06 15:23:38 +08:00
locale: localeFromProps,
2024-11-06 11:55:19 +08:00
}: DescriptionProps) => {
2024-11-06 15:23:38 +08:00
const localeDefault = getLocaleOnServer()
const { t } = await translate(localeFromProps || localeDefault, 'plugin')
2024-11-14 14:56:15 +08:00
const { t: tCommon } = await translate(localeFromProps || localeDefault, 'common')
2024-11-06 11:55:19 +08:00
2024-10-12 12:46:29 +08:00
return (
<>
2024-11-07 15:37:22 +08:00
<h1 className='shrink-0 mb-2 text-center title-4xl-semi-bold text-text-primary'>
2024-11-08 16:13:52 +08:00
{t('marketplace.empower')}
2024-10-12 12:46:29 +08:00
</h1>
2024-11-07 15:37:22 +08:00
<h2 className='shrink-0 flex justify-center items-center text-center body-md-regular text-text-tertiary'>
2024-11-08 16:13:52 +08:00
{t('marketplace.discover')}
2024-11-14 14:26:02 +08:00
<span className="relative ml-1 body-md-medium text-text-secondary after:content-[''] after:absolute after:left-0 after:bottom-[1.5px] after:w-full after:h-2 after:bg-text-text-selected z-[1]">
2024-11-14 16:37:33 +08:00
<span className='relative z-[2] lowercase'>{t('category.models')}</span>
2024-10-12 12:46:29 +08:00
</span>
,
2024-11-14 14:26:02 +08:00
<span className="relative ml-1 body-md-medium text-text-secondary after:content-[''] after:absolute after:left-0 after:bottom-[1.5px] after:w-full after:h-2 after:bg-text-text-selected z-[1]">
2024-11-14 16:37:33 +08:00
<span className='relative z-[2] lowercase'>{t('category.tools')}</span>
2024-10-12 12:46:29 +08:00
</span>
,
2024-11-14 14:26:02 +08:00
<span className="relative ml-1 mr-1 body-md-medium text-text-secondary after:content-[''] after:absolute after:left-0 after:bottom-[1.5px] after:w-full after:h-2 after:bg-text-text-selected z-[1]">
2024-11-14 16:37:33 +08:00
<span className='relative z-[2] lowercase'>{t('category.extensions')}</span>
2024-10-12 12:46:29 +08:00
</span>
2024-11-08 16:13:52 +08:00
{t('marketplace.and')}
2024-11-14 14:26:02 +08:00
<span className="relative ml-1 mr-1 body-md-medium text-text-secondary after:content-[''] after:absolute after:left-0 after:bottom-[1.5px] after:w-full after:h-2 after:bg-text-text-selected z-[1]">
2024-11-14 16:37:33 +08:00
<span className='relative z-[2] lowercase'>{t('category.bundles')}</span>
2024-10-12 12:46:29 +08:00
</span>
2024-11-14 14:56:15 +08:00
<span className='mr-1'>{tCommon('operation.in')}</span>
{t('marketplace.difyMarketplace')}
2024-10-12 12:46:29 +08:00
</h2>
</>
)
}
2024-10-12 16:34:02 +08:00
export default Description