mdx: rename getMDXComponents to useMDXComponents convention, remove ClientButton

This commit is contained in:
2026-06-02 01:06:12 -05:00
parent 0cdfeb8b89
commit f4db327d7a

View File

@@ -1,7 +1,7 @@
import type { MDXComponents } from 'mdx/types'
import { ClientButton } from '@/components/blog/button-client'
export function getMDXComponents(components: MDXComponents): MDXComponents {
export function useMDXComponents(components: MDXComponents): MDXComponents {
return {
...components,
// Typography
@@ -106,10 +106,5 @@ export function getMDXComponents(components: MDXComponents): MDXComponents {
// Collapsible sections
details: (props) => <details className="my-4 rounded-lg border border-border p-4" {...props} />,
summary: (props) => <summary className="cursor-pointer font-semibold" {...props} />,
button: ({ children, onClick, ...props }) => {
const onClickString = typeof onClick === 'string' ? onClick : undefined
return <ClientButton onClick={onClickString} {...props}>{children}</ClientButton>
},
}
}