Files
supabase/apps/studio/components/layouts/Tabs/MigrateToPostgres.tsx
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

47 lines
1.7 KiB
TypeScript

import { motion } from 'framer-motion'
import { BaggageClaim, BookOpen } from 'lucide-react'
import { Button } from 'ui'
// not in use yet
export const MigrateToPostgres = () => (
<motion.div
className="w-full rounded-lg overflow-hidden relative border border-muted"
variants={{
hidden: { opacity: 0, scale: 0.96, y: 15 },
show: {
opacity: 1,
scale: 1,
y: 0,
transition: {
type: 'spring',
stiffness: 600,
damping: 50,
staggerChildren: 0.08,
delayChildren: 0.03,
},
},
}}
>
<div className="absolute inset-0 bg-linear-to-r from-background-surface-200 via-background-surface-200 to-transparent"></div>
<div className="relative z-10 px-5 py-4 h-full flex gap-5 items-center justify-between">
<div className="flex flex-col gap-3">
<div className="flex gap-4">
<div className="inline-flex items-center justify-center w-7 h-7 rounded-lg bg-surface-300 border">
<BaggageClaim size={14} className="text-foreground-light" strokeWidth={1.5} />
</div>
<div className="flex flex-col gap-1">
<h2 className="text-base text-foreground">Migrate your Database to Postgres</h2>
<p className="text-xs text-foreground-light max-w-md">
Already have a database? Migrate any database to Supabase to access backups, RESTful
auto APIs, Authentication and more.
</p>
</div>
</div>
</div>
<Button variant="default" className="rounded-full" iconRight={<BookOpen />}>
Migrate to Postgres
</Button>
</div>
</motion.div>
)