import React, { PropsWithChildren } from 'react'; export type AdmonitionType = | 'note' | 'tip' | 'warning' | 'important' | 'caution'; const infimaMappings: Record = { note: 'secondary', important: 'info', tip: 'success', warning: 'danger', caution: 'danger' }; // From https://github.com/elviswolcott/remark-admonitions/blob/master/lib/index.js const types = { note: { ifmClass: 'secondary', keyword: 'note', emoji: 'ℹ️', // 'ℹ' svg: '' }, tip: { ifmClass: 'success', keyword: 'tip', emoji: '💡', //'💡' svg: '' }, warning: { ifmClass: 'danger', keyword: 'warning', emoji: '🔥', //'🔥' svg: '' }, important: { ifmClass: 'info', keyword: 'important', emoji: '❗️', //'❗' svg: '' }, caution: { ifmClass: 'warning', keyword: 'caution', emoji: '⚠️', // '⚠️' svg: '' } }; export default function AdmonitionMDX({ type, children }: PropsWithChildren<{ type: AdmonitionType; }>) { return (
{type}
{children}
); }