import { __ } from "@wordpress/i18n";
import "./editor.scss";

import { useBlockProps, RichText } from "@wordpress/block-editor";

export default function Edit({ attributes, setAttributes, ...props }) {
	let { childName } = attributes;

	function onChangeChildName(childName) {
		setAttributes({ childName });
	}

	return (
		<>
			<div
				{...useBlockProps({
					className: `homegrade-blocks-staff-member`,
				})}
			>
				<RichText
					tagName="p"
					className="homegrade-blocks-staff-member__child-name"
					onChange={onChangeChildName}
					value={childName}
					placeholder="Nom de l'enfant"
				/>
			</div>
		</>
	);
}
