Skip to content

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

Broken jsx return

Terry Sutton2fb75d56b380
diff --git a/apps/docs/pages/reference/dart/[...slug].tsx b/apps/docs/pages/reference/dart/[...slug].tsx
index 696ce408ac7..b72a7b9b6f4 100644
--- a/apps/docs/pages/reference/dart/[...slug].tsx
+++ b/apps/docs/pages/reference/dart/[...slug].tsx
@@ -67,163 +67,162 @@ export default function DartReference(props) {
const shortText = hasTsRef ? tsDefinition.signatures[0].comment.shortText : ''
return (
- <RefSubLayout.Section
- key={item.id}
- title={
- examples.functions[itemIndex].title ??
- examples.functions[itemIndex].id ??
- item.name ??
- item.id
- }
- id={item.id}
- slug={commonLibSpec.functions.find((commonItem) => commonItem.id === item.id).slug}
- >
- <RefSubLayout.Details>
- <>
- <header className={['mb-16'].join(' ')}>
- {shortText && (
- <>
- <p
- className="text-sm text-scale-1100"
- dangerouslySetInnerHTML={{ __html: shortText }}
- ></p>
- </>
- )}
- </header>
-
- {item.description && (
- <div className="prose">
- <p className="text-sm">{item.description}</p>
- </div>
- )}
- {functionMarkdownContent && (
- <div className="prose">
- <MDXRemote {...functionMarkdownContent} components={components} />
- </div>
- )}
- {item.notes && (
- <div className="prose">
- <ReactMarkdown className="text-sm">{item.notes}</ReactMarkdown>
- </div>
+ <RefSubLayout.Section
+ key={item.id}
+ title={
+ examples.functions[itemIndex].title ??
+ examples.functions[itemIndex].id ??
+ item.name ??
+ item.id
+ }
+ id={item.id}
+ slug={commonLibSpec.functions.find((commonItem) => commonItem.id === item.id).slug}
+ >
+ <RefSubLayout.Details>
+ <>
+ <header className={['mb-16'].join(' ')}>
+ {shortText && (
+ <>
+ <p
+ className="text-sm text-scale-1100"
+ dangerouslySetInnerHTML={{ __html: shortText }}
+ ></p>
+ </>
)}
- {/* // parameters */}
- {parameters && (
- <div className="not-prose mt-12">
- <h5 className="mb-3 text-base">Parameters</h5>
- <ul className="">
- {parameters.map((param) => {
- // grab override params from yaml file
- const overrideParams = item.overrideParams
-
- // params from the yaml file can override the params from parameters if it matches the name
- const overide = overrideParams?.filter((x) => {
- return param.name === x.name
- })
-
- const paramItem = overide?.length > 0 ? overide[0] : param
-
- return (
- <Param {...paramItem} key={paramItem.title}>
- {paramItem.subContent && (
- <div className="mt-3">
- <Options>
- {param.subContent.map((param) => {
- return <Options.Option {...param} />
- })}
- </Options>
- </div>
- )}
- </Param>
- )
- })}
- </ul>
- </div>
- )}
- </>
- </RefSubLayout.Details>
- <RefSubLayout.Examples>
- {item.examples && (
- <>
- <Tabs
- defaultActiveId={item.examples[0].id}
- size="small"
- type="underlined"
- scrollable
- >
- {item.examples &&
- item.examples.map((example, exampleIndex) => {
- const exampleString = `
+ </header>
+
+ {item.description && (
+ <div className="prose">
+ <p className="text-sm">{item.description}</p>
+ </div>
+ )}
+ {functionMarkdownContent && (
+ <div className="prose">
+ <MDXRemote {...functionMarkdownContent} components={components} />
+ </div>
+ )}
+ {item.notes && (
+ <div className="prose">
+ <ReactMarkdown className="text-sm">{item.notes}</ReactMarkdown>
+ </div>
+ )}
+ {/* // parameters */}
+ {parameters && (
+ <div className="not-prose mt-12">
+ <h5 className="mb-3 text-base">Parameters</h5>
+ <ul className="">
+ {parameters.map((param) => {
+ // grab override params from yaml file
+ const overrideParams = item.overrideParams
+
+ // params from the yaml file can override the params from parameters if it matches the name
+ const overide = overrideParams?.filter((x) => {
+ return param.name === x.name
+ })
+
+ const paramItem = overide?.length > 0 ? overide[0] : param
+
+ return (
+ <Param {...paramItem} key={paramItem.title}>
+ {paramItem.subContent && (
+ <div className="mt-3">
+ <Options>
+ {param.subContent.map((param) => {
+ return <Options.Option {...param} />
+ })}
+ </Options>
+ </div>
+ )}
+ </Param>
+ )
+ })}
+ </ul>
+ </div>
+ )}
+ </>
+ </RefSubLayout.Details>
+ <RefSubLayout.Examples>
+ {item.examples && (
+ <>
+ <Tabs
+ defaultActiveId={item.examples[0].id}
+ size="small"
+ type="underlined"
+ scrollable
+ >
+ {item.examples &&
+ item.examples.map((example, exampleIndex) => {
+ const exampleString = `
import { createClient } from '@supabase/supabase-js'
// Create a single supabase client for interacting with your database
const supabase = createClient('https://xyzcompany.supabase.co', 'public-anon-key')
`
- const currentExampleId = example.id
- const staticExample = item.examples[exampleIndex]
-
- const response = staticExample.response
- const sql = staticExample?.data?.sql
- const tables = staticExample?.data?.tables
-
- return (
- <Tabs.Panel id={example.id} label={example.name}>
- {tables &&
- tables.length > 0 &&
- tables.map((table) => {
- return (
- <div className="bg-scale-300 border rounded prose max-w-none">
- <div className="bg-scale-200 px-5 py-2">
- <div className="flex gap-2 items-center">
- <div className="text-brand-900">
- <IconDatabase size={16} />
- </div>
- <h5 className="text-xs text-scale-1200">{table.name}</h5>
+ const currentExampleId = example.id
+ const staticExample = item.examples[exampleIndex]
+
+ const response = staticExample.response
+ const sql = staticExample?.data?.sql
+ const tables = staticExample?.data?.tables
+
+ return (
+ <Tabs.Panel id={example.id} label={example.name}>
+ {tables &&
+ tables.length > 0 &&
+ tables.map((table) => {
+ return (
+ <div className="bg-scale-300 border rounded prose max-w-none">
+ <div className="bg-scale-200 px-5 py-2">
+ <div className="flex gap-2 items-center">
+ <div className="text-brand-900">
+ <IconDatabase size={16} />
</div>
+ <h5 className="text-xs text-scale-1200">{table.name}</h5>
</div>
</div>
- )
- })}
- {sql && (
- <CodeBlock
- className="useless-code-block-class"
- language="sql"
- hideLineNumbers={true}
- >
- {sql}
- </CodeBlock>
- )}
+ </div>
+ )
+ })}
+ {sql && (
<CodeBlock
className="useless-code-block-class"
- language="js"
+ language="sql"
hideLineNumbers={true}
>
- {exampleString +
- (example.code &&
- example.code
- .replace('```', '')
- .replace('js', '')
- .replace('```', ''))}
+ {sql}
</CodeBlock>
- {response && (
- <>
- <CodeBlock
- className="useless-code-block-class"
- language="json"
- hideLineNumbers={true}
- >
- {response}
- </CodeBlock>
- </>
- )}
- </Tabs.Panel>
- )
- })}
- </Tabs>
- </>
- )}
- </RefSubLayout.Examples>
- </RefSubLayout.Section>
- </>
+ )}
+ <CodeBlock
+ className="useless-code-block-class"
+ language="js"
+ hideLineNumbers={true}
+ >
+ {exampleString +
+ (example.code &&
+ example.code
+ .replace('```', '')
+ .replace('js', '')
+ .replace('```', ''))}
+ </CodeBlock>
+ {response && (
+ <>
+ <CodeBlock
+ className="useless-code-block-class"
+ language="json"
+ hideLineNumbers={true}
+ >
+ {response}
+ </CodeBlock>
+ </>
+ )}
+ </Tabs.Panel>
+ )
+ })}
+ </Tabs>
+ </>
+ )}
+ </RefSubLayout.Examples>
+ </RefSubLayout.Section>
)
})}
</RefSubLayout>