MCPcopy Create free account
hub / github.com/bridge-codes/bridge / TypePreview

Function TypePreview

www/src/components/NewCode.tsx:114–144  ·  view source on GitHub ↗
({ code, position }: { code: string; position: PositionInterface })

Source from the content-addressed store, hash-verified

112};
113
114const TypePreview = ({ code, position }: { code: string; position: PositionInterface }) => {
115 return (<div className={`border bg-opacity-10 backdrop-blur-md bg-neutral-500 text-xs border-white border-opacity-10 p-3 max-w-max z-10 absolute rounded-md left-o top-0`} style={{
116 top: position.top,
117 left: position.left,
118 opacity: position.top > 0 ? 1 : 0,
119 transition: "opacity 0.300s, transform 0.5s",
120 transform: position.top > 0 ? "translateY(-10px)" : "translateY(0px)"
121 }}>
122 {code &&
123 <Highlight {...defaultProps} theme={theme} code={code} language={'typescript'}>
124 {({ className, style, tokens, getLineProps, getTokenProps }) => (
125 <pre
126 className={className}
127 style={{
128 background: 'transparent',
129 padding: 0
130 }}
131 >
132 {tokens.map((line, i) => (
133 <div key={i}>
134 {line.map((token, key) => (
135 <span key={key} {...getTokenProps({ token, key })} />
136 ))}
137 </div>
138 ))}
139 </pre>
140 )}
141 </Highlight>
142 }
143 </div>)
144}
145
146const NewCustomCodeLine = ({ line, typesToDisplay, showLineNumber, lineNumber, getLineProps, getTokenProps, hide, highlight }:
147 {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected