import React, {useEffect, useState} from 'react';
import { Textarea } from '../ui/input';
const LayoutEditor = ({layout, onChange}) => {
    const [_layout, setLayout] = useState(layout || "");
    useEffect(() => {setLayout(layout)}, [layout]);
    return (
        <Textarea
            className="h-[60vh] font-mono text-sm"
            value={_layout}
            onChange={(e) => {
                setLayout(e.target.value);
                onChange(e.target.value);
            }}
        />
    );
};

export default LayoutEditor;
