2023-01-29 16:44:02 +01:00
|
|
|
import { Popout } from 'shared/components/popout.mjs'
|
|
|
|
import { Highlight } from './highlight.mjs'
|
|
|
|
import { YouTube } from './youtube.mjs'
|
2023-05-19 16:31:28 +02:00
|
|
|
//import { Figure } from './figure.mjs'
|
2023-05-15 20:00:45 +02:00
|
|
|
import { ReadMore } from './read-more.mjs'
|
2023-01-29 16:44:02 +01:00
|
|
|
import { Tab, Tabs } from './tabs.mjs'
|
|
|
|
import { TabbedExample as Example } from './tabbed-example.mjs'
|
|
|
|
import { HttpMethod, HttpStatusCode } from './http.mjs'
|
2023-05-15 15:57:46 +02:00
|
|
|
import { ControlTip } from '../control/tip.mjs'
|
2023-05-19 11:46:17 +02:00
|
|
|
import { Legend } from './legend.mjs'
|
2023-05-21 10:11:26 +02:00
|
|
|
import { DocsTitle } from './docs-title.mjs'
|
2023-05-19 11:46:17 +02:00
|
|
|
import { V3Wip } from '../v3-wip.mjs'
|
2023-01-27 21:35:45 +01:00
|
|
|
|
2023-05-21 09:41:20 +02:00
|
|
|
export const components = (site = 'org') => {
|
|
|
|
const base = {
|
|
|
|
// Custom components
|
|
|
|
Comment: (props) => <Popout {...props} comment />,
|
|
|
|
Fixme: (props) => <Popout {...props} fixme />,
|
|
|
|
Link: (props) => <Popout {...props} link />,
|
|
|
|
Note: (props) => <Popout {...props} note />,
|
|
|
|
ReadMore: (props) => <ReadMore {...props} site={site} />,
|
|
|
|
Related: (props) => <Popout {...props} related />,
|
|
|
|
Tip: (props) => <Popout {...props} tip />,
|
|
|
|
Warning: (props) => <Popout {...props} warning />,
|
|
|
|
YouTube,
|
|
|
|
pre: (props) => <Highlight {...props} />,
|
|
|
|
// This Figure component causes hydration errors
|
|
|
|
//img: Figure,
|
|
|
|
table: (props) => (
|
|
|
|
<table {...props} className="mdx-table table-auto w-full">
|
|
|
|
{props.children}
|
|
|
|
</table>
|
|
|
|
),
|
|
|
|
Tab,
|
|
|
|
Tabs,
|
|
|
|
ControlTip,
|
|
|
|
Example,
|
2023-05-21 10:11:26 +02:00
|
|
|
DocsTitle: (props) => <DocsTitle {...props} site={site} />,
|
2023-05-21 09:41:20 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
return site === 'dev'
|
|
|
|
? {
|
|
|
|
...base,
|
|
|
|
Method: HttpMethod,
|
|
|
|
StatusCode: HttpStatusCode,
|
|
|
|
}
|
|
|
|
: {
|
|
|
|
...base,
|
|
|
|
PatternDocs: V3Wip,
|
|
|
|
PatternOptions: V3Wip,
|
|
|
|
PatternMeasurements: V3Wip,
|
|
|
|
Gauge: V3Wip,
|
|
|
|
Legend,
|
|
|
|
}
|
2023-05-15 15:57:46 +02:00
|
|
|
}
|