Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. 'use client'
  2. import React from 'react'
  3. import { Layout, Flex, Row, Col } from 'antd'
  4. import Header from '@/components/layout/Header'
  5. import Navigation from '@/components/layout/Navigation'
  6. import { usePathname } from 'next/navigation'
  7. const AppLayout = ({ children }: { children: React.ReactNode }) => {
  8. const pathname = usePathname()
  9. const skipLayoutPrefixes = [
  10. '/user/chat/',
  11. '/user/persona/create',
  12. '/user/knowledge/create',
  13. '/user/settings/profile',
  14. '/user/payment',
  15. '/user/payment',
  16. '/user/pricing'
  17. ];
  18. const shouldSkipLayout = skipLayoutPrefixes.some(prefix =>
  19. pathname.startsWith(prefix)
  20. );
  21. if (shouldSkipLayout) {
  22. return <>{children}</>;
  23. }
  24. return (
  25. <Layout className="!w-full !max-w-[430px] !mx-auto !relative !bg-white">
  26. <Flex vertical className='!h-screen'>
  27. <Row>
  28. <Col span={24}>
  29. <Header />
  30. </Col>
  31. </Row>
  32. <Row className='flex-1 overflow-y-scroll overflow-x-hidden'>
  33. <Col span={24}>{children}</Col>
  34. </Row>
  35. <div>
  36. <Navigation />
  37. </div>
  38. </Flex>
  39. </Layout>
  40. );
  41. }
  42. export default AppLayout;