import type { JSX } from "solid-js"; import { Icon } from "./Icon"; import clsx from "clsx"; const styles = { note: { container: "bg-violet-50", title: "text-violet-900", body: "text-slate-800 [--tw-prose-background:var(--color-slate-50)] prose-a:text-slate-900 prose-code:text-slate-900", }, warning: { container: "bg-amber-50", title: "text-amber-900", body: "text-slate-800 [--tw-prose-underline:var(--color-slate-400)] [--tw-prose-background:var(--color-slate-50)] prose-a:text-slate-900 prose-code:text-slate-900", }, question: { container: "bg-amber-50", title: "text-amber-900", body: "text-slate-800 [--tw-prose-underline:var(--color-slate-400)] [--tw-prose-background:var(--color-slate-50)] prose-a:text-slate-900 prose-code:text-slate-900", }, }; const icons = { note: (props: { class?: string }) => , warning: (props: { class?: string }) => ( ), question: (props: { class?: string }) => ( ), }; export default function Callout({ title, children, type = "note", collapsible = false, }: { title: string; children: JSX.Element; type?: keyof typeof styles; collapsible?: boolean; }) { const IconComponent = icons[type]; return (

{title}

{children}
); }