import { __ } from "@wordpress/i18n";
import { useBlockProps, RichText } from "@wordpress/block-editor";
import "./editor.scss";

export default function Edit({ attributes, setAttributes, context }) {
	const { content } = attributes;
	const interviewedPersonName =
		context["dynamiques-blocks/interviewedPersonName"];

	return (
		<div {...useBlockProps()}>
			<span className="interviewed-person-name">{interviewedPersonName} </span>
			<RichText
				placeholder={__("Réponse", "interview")}
				value={content}
				onChange={(value) => setAttributes({ content: value })}
			/>
		</div>
	);
}
