mirror of
https://github.com/supabase/supabase.git
synced 2026-05-09 10:19:50 -04:00
35905e70d5
<!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Logo field now accepts/editable logo URL, plus a new storage-based Logo Picker to select or remove images from project storage. * Full storage picker: browse buckets, columns/list views, search, drag‑and‑drop uploads, file previews (image/audio/video), and single-file selection with responsive mobile/desktop layouts. * **Refactor** * Logo submission streamlined to send the provided URL directly (legacy file-read/upload flow removed). <!-- end of auto-generated comment: release notes by coderabbit.ai -->
35 lines
927 B
TypeScript
35 lines
927 B
TypeScript
import { PermissionAction } from '@supabase/shared-types/out/constants'
|
|
import { Plus } from 'lucide-react'
|
|
import { MouseEventHandler } from 'react'
|
|
|
|
import { ButtonTooltip } from '@/components/ui/ButtonTooltip'
|
|
import { useAsyncCheckPermissions } from '@/hooks/misc/useCheckPermissions'
|
|
|
|
export const CreateBucketButton = ({
|
|
onClick,
|
|
}: {
|
|
onClick: MouseEventHandler<HTMLButtonElement>
|
|
}) => {
|
|
const { can: canCreateBuckets } = useAsyncCheckPermissions(PermissionAction.STORAGE_WRITE, '*')
|
|
|
|
return (
|
|
<ButtonTooltip
|
|
block
|
|
size="tiny"
|
|
type="primary"
|
|
className="w-fit"
|
|
icon={<Plus size={14} />}
|
|
disabled={!canCreateBuckets}
|
|
onClick={onClick}
|
|
tooltip={{
|
|
content: {
|
|
side: 'bottom',
|
|
text: !canCreateBuckets ? 'You need additional permissions to create buckets' : undefined,
|
|
},
|
|
}}
|
|
>
|
|
New bucket
|
|
</ButtonTooltip>
|
|
)
|
|
}
|