Skip to content

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

924 B
Raw Blame
import type { Components } from 'react-markdown'

export const markdownComponents: Components = {
  code: ({ className, ...props }) =>
    className ? (
      <code {...props} className="font-mono text-sm whitespace-pre block min-w-0" />
    ) : (
      <code {...props} />
    ),
  pre: ({ node, ...props }) => (
    <pre
      {...props}
      className="bg-surface-200 text-foreground p-4 rounded-lg mb-3 w-full min-w-0 overflow-x-auto font-mono text-sm whitespace-pre"
    />
  ),
  a: ({ node, ...props }) => (
    <a
      {...props}
      className="text-primary hover:underline break-all"
      target="_blank"
      rel="noopener noreferrer"
    />
  ),
  p: ({ node, ...props }) => <p {...props} className="mb-3 last:mb-0" />,
  ul: ({ node, ...props }) => <ul {...props} className="list-disc pl-5 space-y-1 mb-3" />,
  ol: ({ node, ...props }) => <ol {...props} className="list-decimal pl-5 space-y-1 mb-3" />,
}