"use client";
import ReactQuill from "react-quill";
import "react-quill/dist/quill.snow.css";

interface Props {
    data: string;
    onChange: (data: string) => void;
}

export default function EditorInner({ data, onChange }: Props) {
    const modules = {
        toolbar: [
            [{ heading: [1, 2, 3, 4, 5, 6, false] }],
            ["bold", "italic", "underline", "strike"],
            [{ list: "ordered" }, { list: "bullet" }],
            ["link", "image"],
            ["clean"],
        ],
    };

    return (
        <ReactQuill
            theme="snow"
            value={data}
            onChange={onChange}
            modules={modules}
            style={{ minHeight: "200px" }}
        />
    );
}