Files
supabase/apps/studio/components/interfaces/Storage/NewBucketButton.tsx
Ivan Vasilov 35905e70d5 feat: Add a logo picker for OAuth app creation sheet (#44995)
<!-- 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 -->
2026-05-06 16:44:18 +02:00

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>
)
}