Code.jsx20 lines · 516 B · raw
1// type Props = {
2//   containerRef:  React.MutableRefObject<HTMLElement | null>,
3//   editorRef:  React.MutableRefObject<HTMLElement | null>,
4//   init: () => void
5// }
6export function Code(Props) {
7  const { editorRef, containerRef, init } = Props;
8
9  return (
10    <section
11      className={'code-container text-gray-100 cursor-text pb-0 overflow-auto grow z-10'}
12      ref={(el) => {
13        containerRef.current = el;
14        if (!editorRef.current) {
15          init();
16        }
17      }}
18    ></section>
19  );
20}