APIKeysLayout.tsx 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. import { useParams } from 'common'
  2. import { PropsWithChildren } from 'react'
  3. import { PageLayout } from '@/components/layouts/PageLayout/PageLayout'
  4. import { ScaffoldContainer } from '@/components/layouts/Scaffold'
  5. import { DocsButton } from '@/components/ui/DocsButton'
  6. import { DOCS_URL } from '@/lib/constants'
  7. const ApiKeysLayout = ({ children }: PropsWithChildren) => {
  8. const { ref: projectRef } = useParams()
  9. const navigationItems = [
  10. {
  11. label: 'publishable and secret api keys',
  12. href: `/project/${projectRef}/settings/api-keys`,
  13. id: 'new-keys',
  14. },
  15. {
  16. label: 'legacy anon, service_role api keys',
  17. href: `/project/${projectRef}/settings/api-keys/legacy`,
  18. id: 'legacy-keys',
  19. },
  20. ]
  21. return (
  22. <PageLayout
  23. title="api keys"
  24. subtitle="configure api keys to securely control access to your project"
  25. navigationItems={navigationItems}
  26. secondaryActions={<DocsButton href={`${DOCS_URL}/guides/api/api-keys`} />}
  27. >
  28. <ScaffoldContainer className="flex flex-col py-8 gap-8" bottomPadding>
  29. {children}
  30. </ScaffoldContainer>
  31. </PageLayout>
  32. )
  33. }
  34. export default ApiKeysLayout