Skip to content

A modern and easy to use dashboard. 80+ integrations. 20K+ icons built in. Authentication out of the box. No YAML, drag and drop configuration.

601 B
Raw Blame
import { Callout } from "fumadocs-ui/components/callout";
import type { ReactNode } from "react";

interface AdmonitionProps {
  children: ReactNode;
  title?: ReactNode;
  type?: "caution" | "danger" | "info" | "note" | "success" | "tip" | "warning";
}

const typeMap = {
  caution: "warn",
  danger: "error",
  info: "info",
  note: "info",
  success: "success",
  tip: "idea",
  warning: "warn",
} as const;

export default function Admonition({ children, title, type = "note" }: AdmonitionProps) {
  return (
    <Callout title={title} type={typeMap[type]}>
      {children}
    </Callout>
  );
}