"use client";

import { LexicalRichTextEditor } from "@/components/lexical/lexical-rich-text-editor";
import { useLocale } from "next-intl";

interface PageContentEditorProps {
  value: string;
  onChange: (value: string) => void;
  placeholder: string;
  className?: string;
}

export function PageContentEditor({ value, onChange, placeholder, className }: PageContentEditorProps) {
  const locale = useLocale();
  return (
    <LexicalRichTextEditor
      value={value}
      onChange={onChange}
      placeholder={placeholder}
      dir={locale === "ar" ? "rtl" : "ltr"}
      className={className}
      namespace="PageEditor"
    />
  );
}
