Skip to content

Commit 08d8b47

Browse files
committed
解答例にタイトル付与可能
1 parent 60b00ab commit 08d8b47

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

src/components/Answer/index.jsx

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,14 @@ import Details from "@theme/Details";
44
/**
55
* component that hide an answer
66
*/
7-
export default function Answer({ children }) {
8-
return <Details summary={<summary>解答例</summary>}>{children}</Details>;
7+
export default function Answer({ type = undefined, children }) {
8+
return (
9+
<Details
10+
summary={
11+
type ? <summary>{type} の解答例</summary> : <summary>解答例</summary>
12+
}
13+
>
14+
{children}
15+
</Details>
16+
);
917
}

0 commit comments

Comments
 (0)