StorageBucketsError.tsx 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. import { SupportCategories } from '@supabase/shared-types/out/constants'
  2. import { useParams } from 'common'
  3. import { Button } from 'ui'
  4. import { Admonition } from 'ui-patterns/admonition'
  5. import { SupportLink } from '../Support/SupportLink'
  6. import type { ResponseError } from '@/types'
  7. export interface StorageBucketsErrorProps {
  8. error: ResponseError
  9. }
  10. const StorageBucketsError = ({ error }: StorageBucketsErrorProps) => {
  11. const { ref } = useParams()
  12. return (
  13. <div className="storage-container flex items-center justify-center grow">
  14. <div>
  15. <Admonition
  16. type="warning"
  17. layout="horizontal"
  18. title="Failed to fetch buckets"
  19. description={
  20. <>
  21. <p className="mb-1">
  22. Please try refreshing your browser, or contact support if the issue persists
  23. </p>
  24. <p>Error: {(error as any)?.message ?? 'Unknown'}</p>
  25. </>
  26. }
  27. actions={
  28. <Button key="contact-support" asChild type="default" className="ml-4">
  29. <SupportLink
  30. queryParams={{
  31. projectRef: ref,
  32. category: SupportCategories.DASHBOARD_BUG,
  33. subject: 'Unable to fetch storage buckets',
  34. }}
  35. >
  36. Contact support
  37. </SupportLink>
  38. </Button>
  39. }
  40. />
  41. </div>
  42. </div>
  43. )
  44. }
  45. export default StorageBucketsError