Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

chore: better wrappers empty state (#28204)

Alaister Young6234b1b3c89e
diff --git a/apps/studio/components/interfaces/Database/Wrappers/Wrappers.tsx b/apps/studio/components/interfaces/Database/Wrappers/Wrappers.tsx
index a4e1f78a1a5..83b04d5f72f 100644
--- a/apps/studio/components/interfaces/Database/Wrappers/Wrappers.tsx
+++ b/apps/studio/components/interfaces/Database/Wrappers/Wrappers.tsx
@@ -7,7 +7,7 @@ import WrapperRow from './WrapperRow'
import { WRAPPERS } from './Wrappers.constants'
import { wrapperMetaComparator } from './Wrappers.utils'
import WrappersDisabledState from './WrappersDisabledState'
-import WrappersDropdown from './WrappersDropdown'
+import WrappersEmptyState from './WrappersEmptyState'
const Wrappers = ({ isEnabled }: { isEnabled: boolean }) => {
const { project } = useProjectContext()
@@ -26,15 +26,7 @@ const Wrappers = ({ isEnabled }: { isEnabled: boolean }) => {
{isEnabled ? (
<div>
{wrappers.length === 0 ? (
- <div
- className={[
- 'border rounded border-default px-20 py-16',
- 'flex flex-col items-center justify-center gap-y-4',
- ].join(' ')}
- >
- <p className="text-foreground-light text-sm">No wrappers created yet</p>
- <WrappersDropdown align="center" buttonText="Create a new wrapper" />
- </div>
+ <WrappersEmptyState />
) : (
<>
{WRAPPERS.map((wrapper, i) => {
diff --git a/apps/studio/components/interfaces/Database/Wrappers/WrappersEmptyState.tsx b/apps/studio/components/interfaces/Database/Wrappers/WrappersEmptyState.tsx
new file mode 100644
index 00000000000..39bc4db5957
--- /dev/null
+++ b/apps/studio/components/interfaces/Database/Wrappers/WrappersEmptyState.tsx
@@ -0,0 +1,41 @@
+import { useParams } from 'common'
+import Image from 'next/image'
+import Link from 'next/link'
+import { Card } from 'ui'
+import { WRAPPERS } from './Wrappers.constants'
+import CardButton from 'components/ui/CardButton'
+
+const WrappersEmptyState = () => {
+ const { ref } = useParams()
+
+ return (
+ <div className="flex flex-col gap-4">
+ <hr />
+ <div className="flex flex-col gap-1">
+ <h2 className="text-foreground text-xl">No wrappers created yet</h2>
+ <p className="prose text-sm">Create a new wrapper by choosing one below</p>
+ </div>
+
+ <div className="grid sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-4">
+ {WRAPPERS.map((wrapper) => (
+ <CardButton
+ linkHref={`/project/${ref}/database/wrappers/new?type=${wrapper.name.toLowerCase()}`}
+ title={wrapper.label}
+ fixedHeight={false}
+ >
+ <div className="flex items-center justify-center mt-3 mb-1">
+ <Image
+ width={40}
+ height={40}
+ src={wrapper.icon}
+ alt={`${wrapper.name} wrapper icon`}
+ />
+ </div>
+ </CardButton>
+ ))}
+ </div>
+ </div>
+ )
+}
+
+export default WrappersEmptyState