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

export default function save({ attributes }) {
	const { ctaTextLabel, ctaLink } = attributes;
	const link = ctaLink.url ?? "#";
	return (
		<RichText.Content
			{...useBlockProps.save({
				className: `homegrade-blocks-cta-slim`,
			})}
			tagName="a"
			value={ctaTextLabel}
			href={link}
		/>
	);
}
