The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.
TypeScript aialternativeauthdatabasedenoembeddingsexamplefirebasenextjsoauth2pgvectorpostgispostgrespostgresqlpostgrestrealtimesupabasevectorswebsockets
Init FDW rows
Joshen Lime94f459560d5
diff --git a/studio/components/interfaces/Database/Wrappers/WrapperRow.tsx b/studio/components/interfaces/Database/Wrappers/WrapperRow.tsxnew file mode 100644index 00000000000..32b7d4ccd8b--- /dev/null+++ b/studio/components/interfaces/Database/Wrappers/WrapperRow.tsx@@ -0,0 +1,86 @@+import Image from 'next/image'+import { FC } from 'react'+import { Collapsible, Form, IconCheck, IconChevronUp } from 'ui'+import { Wrapper } from './types'++interface Props {+ wrapper: Wrapper+ isOpen: boolean+ onOpen: (wrapper: string) => void+}++const WrapperRow: FC<Props> = ({ wrapper, isOpen, onOpen }) => {+ return (+ <Collapsible+ open={isOpen}+ onOpenChange={() => onOpen(wrapper.name)}+ className={[+ 'bg-scale-100 dark:bg-scale-300 ',+ 'hover:bg-scale-200 dark:hover:bg-scale-500',+ 'data-open:bg-scale-200 dark:data-open:bg-scale-500',+ 'border-scale-300',+ 'dark:border-scale-500 hover:border-scale-500',+ 'dark:hover:border-scale-700 data-open:border-scale-700',+ 'data-open:pb-px col-span-12 mx-auto',+ '-space-y-px overflow-hidden',+ 'transition border shadow hover:z-50',+ 'first:rounded-tl first:rounded-tr',+ 'last:rounded-bl last:rounded-br',+ ].join(' ')}+ >+ <Collapsible.Trigger asChild>+ <button+ type="button"+ className="group flex w-full items-center justify-between rounded py-3 px-6 text-scale-1200"+ >+ <div className="flex items-center gap-3">+ <IconChevronUp+ className="text-scale-800 transition data-open-parent:rotate-0 data-closed-parent:rotate-180"+ strokeWidth={2}+ width={14}+ />+ <Image src={wrapper.icon} width={20} height={20} alt={`${wrapper.name} wrapper icon`} />+ <span className="text-sm capitalize">{wrapper.label}</span>+ </div>+ <div className="flex items-center gap-3">+ {false ? (+ <div className="flex items-center gap-1 rounded-full border border-brand-700 bg-brand-200 py-1 px-1 text-xs text-brand-900">+ <span className="rounded-full bg-brand-900 p-0.5 text-xs text-brand-200">+ <IconCheck strokeWidth={2} size={12} />+ </span>+ <span className="px-1">Enabled</span>+ </div>+ ) : (+ <div className="rounded-md border border-scale-500 bg-scale-100 py-1 px-3 text-xs text-scale-900 dark:border-scale-700 dark:bg-scale-300">+ Disabled+ </div>+ )}+ </div>+ </button>+ </Collapsible.Trigger>+ <Form+ name={`provider-${wrapper.name}-form`}+ initialValues={{}}+ // validationSchema={provider.validationSchema}+ onSubmit={() => {}}+ >+ {({ isSubmitting, handleReset, initialValues, values }: any) => {+ return (+ <Collapsible.Content>+ <div+ className="+ group border-t+ border-scale-500 bg-scale-100 py-6 px-6 text-scale-1200 dark:bg-scale-300+ "+ >+ Hello+ </div>+ </Collapsible.Content>+ )+ }}+ </Form>+ </Collapsible>+ )+}++export default WrapperRowdiff --git a/studio/components/interfaces/Database/Wrappers/Wrappers.tsx b/studio/components/interfaces/Database/Wrappers/Wrappers.tsxindex 04cd12e05dd..8c0bf08155d 100644--- a/studio/components/interfaces/Database/Wrappers/Wrappers.tsx+++ b/studio/components/interfaces/Database/Wrappers/Wrappers.tsx@@ -1,8 +1,12 @@import { useProjectContext } from 'components/layouts/ProjectLayout/ProjectContext'import { FormHeader } from 'components/ui/Forms'import { useFDWsQuery } from 'data/fdw/fdws-query'+import { Collapsible, Form, IconCheck, IconLoader, Toggle } from 'ui'import { wrappers } from './data'import WrapperCard from './WrapperCard'+import Image from 'next/image'+import WrapperRow from './WrapperRow'+import { useState } from 'react'const Wrappers = () => {const { project } = useProjectContext()@@ -10,6 +14,7 @@ const Wrappers = () => {projectRef: project?.ref,connectionString: project?.connectionString,})+ const [open, setOpen] = useState<string>('')const enabledWrapperNamesSet = new Set(data?.result.map((fdw) => fdw.name))@@ -26,6 +31,21 @@ const Wrappers = () => {title="Foreign Data Wrappers"description="Connect your database to external systems. Query your data warehouse directly from your database, or query third-party APIs using SQL."/>+ <div>+ {wrappers.map((wrapper) => {+ return (+ <WrapperRow+ wrapper={wrapper}+ isOpen={open === wrapper.name}+ onOpen={(wrapperName) => {+ if (open !== wrapperName) setOpen(wrapperName)+ else setOpen('')+ }}+ />+ )+ })}+ </div>+<div className="space-y-4"><div className="w-full space-y-12">{enabledWrappers.length > 0 && (