mirror of
https://github.com/LukeHagar/better-auth.git
synced 2025-12-06 20:37:44 +00:00
demo: fix React prop spreading warnings in CodeEditor component (#1321)
This commit is contained in:
@@ -32,16 +32,20 @@ export function CodeEditor({ code, language }: CodeEditorProps) {
|
||||
className={`${className} text-sm p-4 w-fit overflow-scroll max-h-[400px] rounded-md`}
|
||||
style={style}
|
||||
>
|
||||
{tokens.map((line, i) => (
|
||||
<div key={i} {...getLineProps({ line, key: i })}>
|
||||
{tokens.map((line, i) => {
|
||||
const lineProps = getLineProps({ line, key: i });
|
||||
return (<div key={i} className={lineProps.className}
|
||||
style={lineProps.style}>
|
||||
<span className="inline-block w-4 mr-3 text-gray-500 select-none">
|
||||
{i + 1}
|
||||
</span>
|
||||
{line.map((token, key) => (
|
||||
<span key={key} {...getTokenProps({ token, key })} />
|
||||
))}
|
||||
</div>
|
||||
))}
|
||||
{line.map((token, key) => {
|
||||
const tokenProps = getTokenProps({token, key})
|
||||
return <span key={key} className={tokenProps.className} style={tokenProps.style} >{tokenProps.children}</span>
|
||||
|
||||
})}
|
||||
</div>)
|
||||
})}
|
||||
</pre>
|
||||
)}
|
||||
</Highlight>
|
||||
|
||||
Reference in New Issue
Block a user