import type { UnitInplaceEditProps } from '@ablogcms/unit-editor/core/types/unit';
import InplaceToolbar from '@ablogcms/unit-editor/components/unit-toolbar/presets/inplace-toolbar';
import { RichEditorUnitContent } from './edit';
import type { RichEditorAttributes } from './types';

function InplaceEdit({ editor, unit }: UnitInplaceEditProps<RichEditorAttributes>) {
  return (
    <div>
      <div>
        <InplaceToolbar
          editor={editor}
          unit={unit}
          features={{
            anker: false,
            align: false,
          }}
        />
      </div>

      <div>
        <RichEditorUnitContent unit={unit} editor={editor} />
      </div>
    </div>
  );
}

export default InplaceEdit;
