index.tsx 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. import {
  2. getLocaleOnServer,
  3. useTranslation as translate,
  4. } from '@/i18n/server'
  5. type DescriptionProps = {
  6. locale?: string
  7. }
  8. const Description = async ({
  9. locale: localeFromProps,
  10. }: DescriptionProps) => {
  11. const localeDefault = getLocaleOnServer()
  12. const { t } = await translate(localeFromProps || localeDefault, 'plugin')
  13. const { t: tCommon } = await translate(localeFromProps || localeDefault, 'common')
  14. const isZhHans = localeFromProps === 'zh-Hans'
  15. return (
  16. <>
  17. <h1 className='shrink-0 mb-2 text-center title-4xl-semi-bold text-text-primary'>
  18. {t('marketplace.empower')}
  19. </h1>
  20. <h2 className='shrink-0 flex justify-center items-center text-center body-md-regular text-text-tertiary'>
  21. {
  22. isZhHans && (
  23. <>
  24. <span className='mr-1'>{tCommon('operation.in')}</span>
  25. {t('marketplace.difyMarketplace')}
  26. {t('marketplace.discover')}
  27. </>
  28. )
  29. }
  30. {
  31. !isZhHans && (
  32. <>
  33. {t('marketplace.discover')}
  34. </>
  35. )
  36. }
  37. <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]">
  38. <span className='relative z-[2] lowercase'>{t('category.models')}</span>
  39. </span>
  40. ,
  41. <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]">
  42. <span className='relative z-[2] lowercase'>{t('category.tools')}</span>
  43. </span>
  44. ,
  45. <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]">
  46. <span className='relative z-[2] lowercase'>{t('category.agents')}</span>
  47. </span>
  48. ,
  49. <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]">
  50. <span className='relative z-[2] lowercase'>{t('category.extensions')}</span>
  51. </span>
  52. {t('marketplace.and')}
  53. <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]">
  54. <span className='relative z-[2] lowercase'>{t('category.bundles')}</span>
  55. </span>
  56. {
  57. !isZhHans && (
  58. <>
  59. <span className='mr-1'>{tCommon('operation.in')}</span>
  60. {t('marketplace.difyMarketplace')}
  61. </>
  62. )
  63. }
  64. </h2>
  65. </>
  66. )
  67. }
  68. export default Description