Skip to content

Commit 5c60f0c

Browse files
committed
feat: Use Before, During, After components in shikiComponent
1 parent 155c8e0 commit 5c60f0c

File tree

1 file changed

+3
-20
lines changed

1 file changed

+3
-20
lines changed

packages/test-case-component/src/components/shikiComponent.tsx

Lines changed: 3 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -6,27 +6,10 @@ export const ShikiComponent: React.FC<{ data: any }> = ({ data }) => {
66
<div className="p-8">
77
<h2 className="dark:text-stone-100">{data.command}</h2>
88
<div className="m-2 border">
9-
{data.before && (
10-
<div
11-
className="p-4"
12-
dangerouslySetInnerHTML={{ __html: data.before }}
13-
/>
14-
)}
15-
{(data.during) && (
16-
<>
17-
<div
18-
className="p-4"
19-
dangerouslySetInnerHTML={{ __html: data.during || data.before }}
20-
/>
21-
</>
22-
)}
9+
<Before content={data.before} />
2310
<div className="command">{data.command}</div>
24-
{data.after && (
25-
<div
26-
className="p-4"
27-
dangerouslySetInnerHTML={{ __html: data.after }}
28-
/>
29-
)}
11+
<During content={data.during} />
12+
<After content={data.after} />
3013
</div>
3114
</div>
3215
<details>

0 commit comments

Comments
 (0)