gcg-website/static/admin/shortcodes/components/image.js

41 lines
849 B
JavaScript
Raw Normal View History

const Image = ({ label, assetSource, handleOpenMediaLibrary }) =>
2023-05-29 16:22:34 +02:00
h(
"span",
2023-09-30 21:15:23 +02:00
{ className: "CMS_Field_wrapper" },
2023-05-29 16:22:34 +02:00
h(
"label",
{
2023-09-30 21:15:23 +02:00
className: "CMS_Label_root CMS_Label_cursor-pointer",
2023-05-29 16:22:34 +02:00
},
label
),
h(
"span",
2023-09-30 21:15:23 +02:00
{ className: "CMS_WidgetFileImage_content" },
2023-05-29 16:22:34 +02:00
h(
"span",
{},
h("img", {
role: "presentation",
src: assetSource,
2023-09-30 21:15:23 +02:00
className: "CMS_Image_root",
2023-05-29 16:22:34 +02:00
})
),
h(
"span",
2023-09-30 21:15:23 +02:00
{ className: "CMS_WidgetFileImage_actions" },
2023-05-29 16:22:34 +02:00
h(
"button",
{
type: "button",
onClick: handleOpenMediaLibrary,
2023-09-30 21:15:23 +02:00
className: "CMS_Button_root CMS_Button_outlined-primary",
2023-05-29 16:22:34 +02:00
},
"Bild auswählen"
)
)
)
);
export default Image;