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

export default function save({ attributes }) {
	const { pictureUrl, pictureAlt, pictureId, pictureCaption } = attributes;

	return (
		<>
			{pictureUrl && (
				<figure
					{...useBlockProps.save({
						className: `homegrade-blocks-labelled-picture`,
					})}
				>
					<img src={pictureUrl} alt={pictureAlt} />
					<figcaption>{pictureCaption}</figcaption>
				</figure>
			)}
		</>
	);
}
