1
1
'use client'
2
2
3
3
import type { Doc } from '@/content'
4
- import { useRef , useLayoutEffect , useState , useEffect } from 'react'
4
+ import { useState , useEffect } from 'react'
5
5
import Link from 'next/link'
6
6
import { DocTracingBeam } from './DocTracingBeam'
7
7
import { Button } from '../ui/button'
@@ -15,7 +15,13 @@ interface Toc {
15
15
depth : number
16
16
}
17
17
18
- const DocToC = ( { doc } : { doc : Doc } ) => {
18
+ const DocToC = ( {
19
+ doc,
20
+ startSteps,
21
+ } : {
22
+ doc : Doc
23
+ startSteps ?: React . JSX . Element | undefined
24
+ } ) => {
19
25
const initial = 14
20
26
const sectionSize = 28
21
27
const offset = 10
@@ -58,8 +64,8 @@ const DocToC = ({ doc }: { doc: Doc }) => {
58
64
} , [ ] )
59
65
60
66
return (
61
- < div className = "hidden h-full min-w-52 md:block" >
62
- < aside className = "sticky top-[calc(var(--header-height)+1px+2rem)] max-h-[calc(100vh-var(--header-height)-3rem)] min-w-40 space-y-6 " >
67
+ < div className = "hidden h-full min-w-64 md:block" >
68
+ < aside className = "sticky top-[calc(var(--header-height)+1px+2rem)] max-h-[calc(100vh-var(--header-height)-3rem)] space-y-8 " >
63
69
{ doc . toc . length ? (
64
70
< div className = "relative flex flex-col" >
65
71
< p className = "mb-2 font-mono text-sm uppercase dark:text-zinc-300" >
@@ -101,6 +107,17 @@ const DocToC = ({ doc }: { doc: Doc }) => {
101
107
</ a >
102
108
</ Button >
103
109
</ div >
110
+ { startSteps && (
111
+ < div className = "flex flex-col" >
112
+ < p className = "mb-2 font-mono text-sm uppercase dark:text-zinc-300" >
113
+ Try this out
114
+ </ p >
115
+ < p className = "mb-2 text-2xs text-muted-foreground" >
116
+ Run these commands in your terminal.
117
+ </ p >
118
+ { startSteps }
119
+ </ div >
120
+ ) }
104
121
</ aside >
105
122
</ div >
106
123
)
0 commit comments