Files
supabase/apps/studio/components/interfaces/Storage/EmptyBucketState.tsx
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

47 lines
1.5 KiB
TypeScript

import { BucketAdd } from 'icons'
import { CreateBucketModal } from './CreateBucketModal'
import { CreateSpecializedBucketModal } from './CreateSpecializedBucketModal'
import { BUCKET_TYPES } from './Storage.constants'
interface EmptyBucketStateProps {
bucketType: keyof typeof BUCKET_TYPES
}
export const EmptyBucketState = ({ bucketType }: EmptyBucketStateProps) => {
const config = BUCKET_TYPES[bucketType]
return (
<aside className="mt-12 border border-dashed w-full bg-surface-100 rounded-lg px-4 py-10 flex flex-col gap-y-3 items-center text-center gap-1 text-balance">
<BucketAdd size={24} strokeWidth={1.5} className="text-foreground-muted" />
<div className="flex flex-col items-center text-center">
<h3>
Create {config.article} {config.singularName} bucket
</h3>
<p className="text-foreground-light text-sm">{config.valueProp}</p>
</div>
{bucketType === 'files' ? (
<CreateBucketModal buttonSize="tiny" buttonType="primary" buttonClassName="w-fit" />
) : (
<CreateSpecializedBucketModal
bucketType={bucketType}
buttonSize="tiny"
buttonType="primary"
buttonClassName="w-fit"
disabled={bucketType === 'vectors'}
tooltip={
bucketType === 'vectors'
? {
content: {
side: 'bottom',
text: 'Vector buckets are not supported yet',
},
}
: undefined
}
/>
)}
</aside>
)
}