Files
supabase/apps/studio/components/interfaces/Storage/StorageMenuV2.tsx
T
Danny WhiteandJoshen Lim f596989ed4 chore: feature flag for new Storage UI (#39093)
* feat: bucket type page and corresponding sidebar

* feat: handle /storage URL redirection based on feature flag

* fix: default sidebar selection

* Use feature flag for feature preview, and have new UI behind feature preview instead

* Remove hardcode

* Minor clean ups

* chore: improve feature preview description

* chore: more descriptive name for general file storage type

* fix: preview image

* Minor nits

---------

Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
2025-10-01 12:16:20 +10:00

31 lines
1019 B
TypeScript

import { useParams } from 'common'
import Link from 'next/link'
import { Menu } from 'ui'
import { BUCKET_TYPES, BUCKET_TYPE_KEYS, DEFAULT_BUCKET_TYPE } from './Storage.constants'
export const StorageMenuV2 = () => {
const { ref, bucketType } = useParams()
const selectedBucketType = bucketType || DEFAULT_BUCKET_TYPE
return (
<Menu type="pills" className="mt-6 flex flex-grow flex-col">
<div className="mx-3">
<Menu.Group title={<span className="uppercase font-mono">Bucket Types</span>} />
{BUCKET_TYPE_KEYS.map((bucketTypeKey) => {
const isSelected = selectedBucketType === 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>
</Menu>
)
}