Files
supabase/apps/studio/components/layouts/EdgeFunctionsLayout/EdgeFunctionsLayout.tsx
T
Saxon FletcherandJoshen Lim 593625c574 Edge functions empty state (#33802)
* page components

* page component changes

* settings but broken saving

* rvert

* use sheet for provider

* styling

* remove things

* Some refactoring and fixing, added JSDocs to layouts

* Smol refactor

* Fix

* Update JSDocs

* updated scaffolding

* update edge functions layout

* remove params

* Clean up

* Spelling

* Clean up FormFieldWrappers

* One last clean up

* create edge functon

* use component

* flag

* fix merge errors

* fix imports

* fix merge issues

* fix import

* fix flag

* remove unused

* simple empty

* empty state improvements

* move templates

* re-add flag

* use templates

* flag

* copy functions

* feature flag it

* Fix issues and clean up

* Smol fix

* Add comment

---------

Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
2025-02-28 01:15:59 +08:00

52 lines
1.3 KiB
TypeScript

import { useRouter } from 'next/router'
import { PropsWithChildren } from 'react'
import { useParams } from 'common'
import { ProductMenu } from 'components/ui/ProductMenu'
import { withAuth } from 'hooks/misc/withAuth'
import ProjectLayout from '../ProjectLayout/ProjectLayout'
const EdgeFunctionsProductMenu = () => {
const { ref: projectRef = 'default' } = useParams()
const router = useRouter()
const page = router.pathname.split('/')[4]
const menuItems = [
{
title: 'Manage',
items: [
{
name: 'Functions',
key: 'main',
pages: [undefined, '[functionSlug]', 'new'],
url: `/project/${projectRef}/functions`,
items: [],
},
{
name: 'Secrets',
key: 'secrets',
url: `/project/${projectRef}/functions/secrets`,
items: [],
},
],
},
]
return <ProductMenu page={page} menu={menuItems} />
}
const EdgeFunctionsLayout = ({ children }: PropsWithChildren<{}>) => {
return (
<ProjectLayout
title="Edge Functions"
product="Edge Functions"
productMenu={<EdgeFunctionsProductMenu />}
isBlocking={false}
>
{children}
</ProjectLayout>
)
}
export default withAuth(EdgeFunctionsLayout)