mirror of
https://github.com/eliasstepanik/strudel.git
synced 2026-01-12 06:08:37 +00:00
22 lines
512 B
JavaScript
22 lines
512 B
JavaScript
// type Props = {
|
|
// containerRef: React.MutableRefObject<HTMLElement | null>,
|
|
// editorRef: React.MutableRefObject<HTMLElement | null>,
|
|
// init: () => void
|
|
// }
|
|
export function Code(Props) {
|
|
const { editorRef, containerRef, init } = Props;
|
|
|
|
return (
|
|
<section
|
|
className={'text-gray-100 cursor-text pb-0 overflow-auto grow'}
|
|
id="code"
|
|
ref={(el) => {
|
|
containerRef.current = el;
|
|
if (!editorRef.current) {
|
|
init();
|
|
}
|
|
}}
|
|
></section>
|
|
);
|
|
}
|