Files
supabase/apps/studio/components/layouts/StorageLayout/StorageBucketsLayout.tsx
T
Danny WhiteandJoshen Lim bf3f26d0a6 feat(studio): list existing analytics buckets (#39500)
* specialized dialog for analytics (and vector) bucket creation

* handle missing wrapper extension and iceberg wrapper integration

* bucket creation improvements

* extension and integration checks

* dialog header consistency

* simplify bucket dialog creation button trigger

* fix subtitle ternary

* example bucket without dynamic route

* create dynamic segment

* fancy connection table

* improve bucket page

* connection table polish

* polish

* delete bucket modal

* improve missing installations design

* new table modal

* fix copy icon

* copy all env button placeholder

* list all analytics buckets

* specialised bucket modal

* shared installer hooks and components

* make iceberg wrapper not dependent on wrapper extension

There are cases where the Iceberg Wrapper can be installed but the Wrapper extension has since been removed

* better admonition copywriting

* todo

* remove later features

* more removal of later work

* remove old comment

* remove unused content

* Nits and hook up create analytics bucket logic

* Nit

---------

Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
2025-10-15 11:48:14 +11:00

50 lines
1.5 KiB
TypeScript

import { PropsWithChildren } from 'react'
import { useParams } from 'common'
import { BUCKET_TYPES } from 'components/interfaces/Storage/Storage.constants'
import { useStorageV2Page } from 'components/interfaces/Storage/Storage.utils'
import { DocsButton } from 'components/ui/DocsButton'
import { PageLayout } from '../PageLayout/PageLayout'
import { ScaffoldContainer } from '../Scaffold'
export const StorageBucketsLayout = ({
title,
hideSubtitle = false,
children,
}: PropsWithChildren<{ title?: string; hideSubtitle?: boolean }>) => {
const { ref } = useParams()
const page = useStorageV2Page()
const config = !!page && page !== 's3' ? BUCKET_TYPES[page] : undefined
const navigationItems =
page === 'files'
? [
{
label: 'Buckets',
href: `/project/${ref}/storage/files`,
},
{
label: 'Settings',
href: `/project/${ref}/storage/files/settings`,
},
{
label: 'Policies',
href: `/project/${ref}/storage/files/policies`,
},
]
: []
return (
<PageLayout
title={title || (config?.displayName ?? 'Storage')}
subtitle={
!hideSubtitle ? config?.description || 'Manage your storage buckets and files.' : null
}
navigationItems={navigationItems}
secondaryActions={config?.docsUrl ? [<DocsButton key="docs" href={config.docsUrl} />] : []}
>
<ScaffoldContainer>{children}</ScaffoldContainer>
</PageLayout>
)
}