1
0
Fork 0
freesewing/sites/shared/components/mdx/index.js

45 lines
1.4 KiB
JavaScript
Raw Normal View History

2021-12-19 19:08:54 +01:00
import Popout from '../popout.js'
import Highlight from './highlight.js'
import YouTube from './youtube.js'
import Figure from './figure.js'
import ReadMore from './read-more.js'
import { Tab, Tabs } from './tabs.js'
import Example from './example.js'
import Examples from './examples.js'
2022-11-19 18:11:04 +01:00
import Method from './http-method.js'
import StatusCode from './status-code.js'
const Fixme = () => <p>FIXME</p>
const mdxCustomComponents = (app = false) => ({
2021-12-19 19:08:54 +01:00
// Custom components
Method,
StatusCode,
Comment: (props) => <Popout {...props} comment />,
Fixme: (props) => <Popout {...props} fixme />,
Link: (props) => <Popout {...props} link />,
Note: (props) => <Popout {...props} note />,
ReadMore: (props) => <ReadMore {...props} app={app} slug={app.slug} />,
Related: (props) => <Popout {...props} related />,
Tip: (props) => <Popout {...props} tip />,
Warning: (props) => <Popout {...props} warning />,
2021-12-19 19:08:54 +01:00
YouTube,
pre: (props) => <Highlight {...props} />,
2021-12-25 13:43:41 +01:00
img: Figure,
table: (props) => (
<table {...props} className="mdx-table table-auto w-full">
{props.children}
</table>
),
2022-09-14 15:02:39 +02:00
Tab,
Tabs,
Example: (props) => <Example {...props} app={app} />,
Examples: (props) => <Examples {...props} app={app} />,
PatternDocs: Fixme,
PatternOptions: Fixme,
2021-12-24 18:17:02 +01:00
})
2021-12-19 19:08:54 +01:00
export default mdxCustomComponents
//<span className="bg-secondary px-2 mx-1 rounded text-primary-content bg-opacity-80">{children}</span>