Files
supabase/apps/studio/components/ui/Error.tsx
T
Gildas GarciaandIvan Vasilov 96d43099bb chore: refactor Button API so that it can be used a standard button (#46880)
## Problem

Our `<Button>` component breaks the default `button` contract by
redefining the `type` prop to set its variant (`primary`, `default`,
etc) instead of the button type (`submit`, `button`, etc).
This is confusing and forces to write more code when using it with
shadcn components that expect/inject the standard button props.

## Solution

- rename the `type` prop to `variant`
- rename the `htmlType` prop to `type`
- propagate the changes where necessary
- format code

## How to test

As this is just prop renaming, if it builds it's ok

---------

Co-authored-by: Ivan Vasilov <vasilov.ivan@gmail.com>
2026-06-16 23:59:58 +02:00

35 lines
1.1 KiB
TypeScript

import Link from 'next/link'
import { useEffect } from 'react'
import { Button } from 'ui'
import { SupportLink } from '@/components/interfaces/Support/SupportLink'
export default function EmptyPageState({ error }: any) {
useEffect(() => {
console.error('Error', error)
}, [])
return (
<div className="mx-auto flex h-full w-full flex-col items-center justify-center space-y-6">
<div className="flex w-[320px] flex-col items-center justify-center space-y-3">
<h4 className="text-lg">Something went wrong 🤕</h4>
<p className="text-center text-sm text-foreground-light">
Sorry about that, please try again later or feel free to reach out to us if the problem
persists.
</p>
</div>
<div className="flex items-center space-x-4">
<Button asChild>
<Link href="/projects">Head back</Link>
</Button>
<Button asChild variant="secondary">
<SupportLink>Submit a support request</SupportLink>
</Button>
</div>
<p className="text-sm text-foreground-light">
Error: [{error?.code}] {error?.message}
</p>
</div>
)
}