APIAuthorizationLayout.tsx 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. import { useTheme } from 'next-themes'
  2. import Image from 'next/legacy/image'
  3. import Link from 'next/link'
  4. import type { PropsWithChildren } from 'react'
  5. import { Separator } from 'ui'
  6. import { Head, type HeadProvider } from '@/components/ui/Head'
  7. import { useCustomContent } from '@/hooks/custom-content/useCustomContent'
  8. import { BASE_PATH } from '@/lib/constants'
  9. export interface APIAuthorizationLayoutProps {
  10. HeadProvider: HeadProvider
  11. }
  12. export const APIAuthorizationLayout = ({
  13. HeadProvider,
  14. children,
  15. }: PropsWithChildren<APIAuthorizationLayoutProps>) => {
  16. const { resolvedTheme } = useTheme()
  17. const { appTitle } = useCustomContent(['app:title'])
  18. return (
  19. <>
  20. <Head
  21. HeadProvider={HeadProvider}
  22. title={`Authorize API access | ${appTitle || 'Briven'}`}
  23. />
  24. <main className="h-screen flex flex-col w-full h-full overflow-y-auto">
  25. <div>
  26. <div className="mx-auto px-4 sm:px-6">
  27. <div className="max-w-xl flex justify-between items-center mx-auto py-4">
  28. <div className="flex justify-start lg:w-0 lg:flex-1 items-center">
  29. <Link href="/" className="inline-flex items-center leading-none">
  30. <span className="sr-only">Briven</span>
  31. <Image
  32. src={
  33. resolvedTheme?.includes('dark')
  34. ? `${BASE_PATH}/img/briven-dark.svg`
  35. : `${BASE_PATH}/img/briven-light.svg`
  36. }
  37. alt="Briven Logo"
  38. height={20}
  39. width={105}
  40. />
  41. </Link>
  42. </div>
  43. </div>
  44. </div>
  45. </div>
  46. <Separator />
  47. <div className="flex flex-col justify-center grow mx-auto w-[90vw] max-w-[600px] space-y-4">
  48. {children}
  49. </div>
  50. </main>
  51. </>
  52. )
  53. }