Skip to content

Commit f64832f

Browse files
authored
Merge pull request #485 from ut-code/improve-answer-tag
Answerタグの改善
2 parents 077cff4 + a14ba5e commit f64832f

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)