Files
supabase/apps/studio/components/interfaces/Storage/StorageMenuV2.tsx
T
Danny WhiteandJoshen Lim 6e88050a85 feat(studio): full file bucket functionality in storage (#39308)
* basic StorageBucketResponse items in table

* basic bucket file explorer

* policy count for each bucket

* don't show root folder on explorer

It's confusing in the new surrounding UI

* fix height for StorageExplorer

* reuse existing header

* fix overrides

* fix additional overrides

* improve table columns

* clarify copywriting and remove redundancy

* organise imports

* minor clean up

---------

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

50 lines
1.5 KiB
TypeScript

import Link from 'next/link'
import { IS_PLATFORM, useParams } from 'common'
import { Menu } from 'ui'
import { BUCKET_TYPES, BUCKET_TYPE_KEYS } from './Storage.constants'
import { useStorageV2Page } from './Storage.utils'
export const StorageMenuV2 = () => {
const { ref } = useParams()
const page = useStorageV2Page()
return (
<Menu type="pills" className="my-6 flex flex-grow flex-col">
<div className="space-y-6">
<div className="mx-3">
<Menu.Group title={<span className="uppercase font-mono">Manage</span>} />
{BUCKET_TYPE_KEYS.map((bucketTypeKey) => {
const isSelected = page === bucketTypeKey
const config = BUCKET_TYPES[bucketTypeKey]
return (
<Link key={bucketTypeKey} href={`/project/${ref}/storage/${bucketTypeKey}`}>
<Menu.Item rounded active={isSelected}>
<p className="truncate">{config.displayName}</p>
</Menu.Item>
</Link>
)
})}
</div>
{IS_PLATFORM && (
<>
<div className="h-px w-full bg-border" />
<div className="mx-3">
<Menu.Group title={<span className="uppercase font-mono">Configuration</span>} />
<Link href={`/project/${ref}/storage/s3`}>
<Menu.Item rounded active={page === 's3'}>
<p className="truncate">S3</p>
</Menu.Item>
</Link>
</div>
</>
)}
</div>
</Menu>
)
}