Files
supabase/apps/studio/components/interfaces/Storage/StorageBucketsError.tsx
Drake Costa 57cd26ac77 Move non-layout Storage components to components/interfaces (#37381)
* Update studio testing setup files

Improves API mocking type safety and polyfills browser APIs necessary to run tests with framer-motion components

* fix missing listen call for msw, resolve test type error

* fix imports

* Update studio testing setup files

Improves API mocking type safety and polyfills browser APIs necessary to run tests with framer-motion components

* fix missing listen call for msw, resolve test type error

* fix imports

* Move non-layout Storage related components to `components/interfaces`

* Fix paths

---------

Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
2025-07-22 23:48:20 +08:00

41 lines
1.1 KiB
TypeScript

import { useParams } from 'common'
import Link from 'next/link'
import type { ResponseError } from 'types'
import { Alert, Button } from 'ui'
export interface StorageBucketsErrorProps {
error: ResponseError
}
const StorageBucketsError = ({ error }: StorageBucketsErrorProps) => {
const { ref } = useParams()
return (
<div className="storage-container flex items-center justify-center flex-grow">
<div>
<Alert
withIcon
variant="warning"
title="Failed to fetch buckets"
actions={[
<Button key="contact-support" asChild type="default" className="ml-4">
<Link
href={`/support/new?projectRef=${ref}&category=dashboard_bug&subject=Unable%20to%20fetch%20storage%20buckets`}
>
Contact support
</Link>
</Button>,
]}
>
<p className="mb-1">
Please try refreshing your browser, or contact support if the issue persists
</p>
<p>Error: {(error as any)?.message ?? 'Unknown'}</p>
</Alert>
</div>
</div>
)
}
export default StorageBucketsError