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

export default function save({ attributes }) {
	let { iconUrl, iconAlt, hasShadow } = attributes;

	return (
		<div
			{...useBlockProps.save({
				className: `homegrade-blocks-icon ${
					hasShadow
						? "homegrade-blocks-icon--has-shadow"
						: "homegrade-blocks-icon--no-shadow"
				} `,
			})}
		>
			{iconUrl && <img src={iconUrl} alt={iconAlt} />}
		</div>
	);
}
