Doc.tsx 635 B

12345678910111213141516171819202122232425262728
  1. 'use client'
  2. import type { FC } from 'react'
  3. import { useContext } from 'use-context-selector'
  4. import TemplateEn from './template/template.en.mdx'
  5. import TemplateZh from './template/template.zh.mdx'
  6. import I18n from '@/context/i18n'
  7. type DocProps = {
  8. apiBaseUrl: string
  9. }
  10. const Doc: FC<DocProps> = ({
  11. apiBaseUrl,
  12. }) => {
  13. const { locale } = useContext(I18n)
  14. return (
  15. <article className='mx-12 pt-16 bg-white rounded-t-xl prose prose-xl'>
  16. {
  17. locale === 'en'
  18. ? <TemplateEn apiBaseUrl={apiBaseUrl} />
  19. : <TemplateZh apiBaseUrl={apiBaseUrl} />
  20. }
  21. </article>
  22. )
  23. }
  24. export default Doc