mirror of
https://github.com/supabase/supabase.git
synced 2026-10-09 11:25:06 +03:00
130 lines
4.5 KiB
TypeScript
130 lines
4.5 KiB
TypeScript
import { AiPromptsIndex } from '~/app/guides/getting-started/ai-prompts/[slug]/AiPromptsIndex'
|
|
import { AiSkillsIndex } from '~/app/guides/getting-started/ai-skills/AiSkillsIndex'
|
|
import { AppleSecretGenerator } from '~/components/AppleSecretGenerator'
|
|
import AuthProviders from '~/components/AuthProviders'
|
|
import { AuthSmsProviderConfig } from '~/components/AuthSmsProviderConfig'
|
|
import ButtonCard from '~/components/ButtonCard'
|
|
import { ComputeDiskLimitsTable } from '~/components/ComputeDiskLimitsTable'
|
|
import { Extensions } from '~/components/Extensions'
|
|
import Image, { type ImageProps } from '~/components/Image'
|
|
import { Mermaid } from '~/components/Mermaid'
|
|
import { MetricsStackCards } from '~/components/MetricsStackCards'
|
|
import { NavData } from '~/components/NavData'
|
|
import { Price } from '~/components/Price'
|
|
import { ProjectConfigVariables } from '~/components/ProjectConfigVariables'
|
|
import { RealtimeLimitsEstimator } from '~/components/RealtimeLimitsEstimator'
|
|
import { RegionsList, SmartRegionsList } from '~/components/RegionsList'
|
|
import { SharedData } from '~/components/SharedData'
|
|
import StepHikeCompact from '~/components/StepHikeCompact'
|
|
import { CodeSampleDummy, CodeSampleWrapper } from '~/features/directives/CodeSample.client'
|
|
import { NamedCodeBlock } from '~/features/directives/CodeTabs.components'
|
|
import { MdxAnchor } from '~/features/docs/MdxAnchor'
|
|
import { Accordion, AccordionItem } from '~/features/ui/Accordion'
|
|
import { CodeBlock } from '~/features/ui/CodeBlock/CodeBlock'
|
|
import InfoTooltip from '~/features/ui/InfoTooltip'
|
|
import { ShowUntil } from '~/features/ui/ShowUntil'
|
|
import { TabPanel, Tabs } from '~/features/ui/Tabs'
|
|
import { ArrowDown, Check, X } from 'lucide-react'
|
|
import Link from 'next/link'
|
|
import { Badge, Button } from 'ui'
|
|
import { Admonition, type AdmonitionProps } from 'ui-patterns/admonition'
|
|
import { GlassPanel } from 'ui-patterns/GlassPanel'
|
|
import { IconPanel } from 'ui-patterns/IconPanel'
|
|
import SqlToRest from 'ui-patterns/SqlToRest'
|
|
import { Heading } from 'ui/src/components/CustomHTMLElements'
|
|
|
|
import { AgentPluginsPanel } from '../ui/AgentPluginsPanel'
|
|
import { ErrorCodes } from '../ui/ErrorCodes'
|
|
import { McpConfigPanel } from '../ui/McpConfigPanel'
|
|
|
|
// Wrap Admonition for Docs-specific styling (within MDX prose, requires a margin-bottom)
|
|
const AdmonitionWithMargin = (props: AdmonitionProps) => {
|
|
return <Admonition {...props} className="mb-8" />
|
|
}
|
|
|
|
/**
|
|
* Route fenced ```mermaid blocks through the Mermaid component; everything else
|
|
* continues through `CodeBlock` for syntax highlighting.
|
|
*/
|
|
const Pre = (props: any) => {
|
|
const child = Array.isArray(props.children) ? props.children[0] : props.children
|
|
const className: unknown = child?.props?.className
|
|
if (typeof className === 'string' && className.split(' ').includes('language-mermaid')) {
|
|
const code = child.props.children
|
|
if (typeof code === 'string') {
|
|
return <Mermaid chart={code.trim()} />
|
|
}
|
|
}
|
|
return <CodeBlock {...props} />
|
|
}
|
|
|
|
const components = {
|
|
Accordion,
|
|
AccordionItem,
|
|
Admonition: AdmonitionWithMargin,
|
|
AgentPluginsPanel,
|
|
AiPromptsIndex,
|
|
AiSkillsIndex,
|
|
AuthSmsProviderConfig,
|
|
AppleSecretGenerator,
|
|
AuthProviders,
|
|
Badge,
|
|
Button,
|
|
ButtonCard,
|
|
CodeSampleDummy,
|
|
CodeSampleWrapper,
|
|
ComputeDiskLimitsTable,
|
|
ErrorCodes,
|
|
Extensions,
|
|
GlassPanel,
|
|
IconArrowDown: ArrowDown,
|
|
IconCheck: Check,
|
|
IconPanel,
|
|
IconX: X,
|
|
Image: (props: ImageProps) => <Image className="rounded-md w-full" {...props} />,
|
|
Link,
|
|
McpConfigPanel,
|
|
Mermaid,
|
|
MetricsStackCards,
|
|
NamedCodeBlock,
|
|
NavData,
|
|
ProjectConfigVariables,
|
|
RealtimeLimitsEstimator,
|
|
RegionsList,
|
|
SmartRegionsList,
|
|
SharedData,
|
|
ShowUntil,
|
|
SqlToRest,
|
|
StepHikeCompact,
|
|
Tabs,
|
|
TabPanel,
|
|
InfoTooltip,
|
|
a: MdxAnchor,
|
|
h2: (props: any) => (
|
|
<Heading tag="h2" {...props}>
|
|
{props.children}
|
|
</Heading>
|
|
),
|
|
h3: (props: any) => (
|
|
<Heading tag="h3" {...props}>
|
|
{props.children}
|
|
</Heading>
|
|
),
|
|
h4: (props: any) => (
|
|
<Heading tag="h4" {...props}>
|
|
{props.children}
|
|
</Heading>
|
|
),
|
|
pre: Pre,
|
|
/**
|
|
* Force inline code tags to go sync, this prevents Heading anchor resolution fail due to
|
|
* our CodeBlock component being async. We need to find a better solution for more future
|
|
* proof MDX rendering. Definitely improving the anchors utility in the ui/Heading component
|
|
* plus having a more resilient highlighting strategy.
|
|
*/
|
|
code: (props: any) => <code {...props}>{props.children}</code>,
|
|
Price,
|
|
}
|
|
|
|
export { components }
|