carhop__plugins__PROD-DEV/plugins/carhop-blocks/blocks/narrative-card/src/Cover.jsx
Antoine M 3cbb753a57
All checks were successful
continuous-integration/drone/push Build is passing
FEATURE Introducing the component
2025-06-30 12:10:39 +02:00

19 lines
445 B
JavaScript

import { MediaPlaceholder } from "@wordpress/block-editor";
export default function Cover({ coverUrl, coverAlt, onSelect }) {
return (
<div className="narrative-card__cover">
{coverUrl && <img src={coverUrl} alt={coverAlt} />}
{!coverUrl && (
<MediaPlaceholder
accept="image/*"
allowedTypes={["image"]}
onSelect={onSelect}
multiple={false}
handleUpload={true}
/>
)}
</div>
);
}