mirror of
https://github.com/LukeHagar/unicorn-utterances.git
synced 2025-12-09 21:07:49 +00:00
UwU add hint styling implementation with jsx markdown transform
This commit is contained in:
22
src/utils/markdown/hints/hints.tsx
Normal file
22
src/utils/markdown/hints/hints.tsx
Normal file
@@ -0,0 +1,22 @@
|
||||
/** @jsxRuntime automatic */
|
||||
import { Node, Element } from "hast";
|
||||
|
||||
interface HintProps {
|
||||
title: string;
|
||||
children: Node[];
|
||||
};
|
||||
|
||||
/** @jsxImportSource hastscript */
|
||||
export function Hint({ title, children }: HintProps): Element {
|
||||
return (
|
||||
<details class="hint">
|
||||
<summary class="hint__title text-style-body-medium-bold">
|
||||
{title}
|
||||
</summary>
|
||||
|
||||
<div class="hint__content">
|
||||
{children}
|
||||
</div>
|
||||
</details>
|
||||
) as never;
|
||||
}
|
||||
Reference in New Issue
Block a user