2023-04-19 22:44:06 +02:00
|
|
|
import {
|
2023-05-29 16:22:34 +02:00
|
|
|
PageHeader,
|
|
|
|
Section,
|
|
|
|
Container,
|
|
|
|
Row,
|
|
|
|
Content,
|
2023-04-19 22:44:06 +02:00
|
|
|
} from "./components/index.js";
|
|
|
|
|
|
|
|
const CantorpreisPreview = ({ widgetFor, entry, fields, collection }) => {
|
2023-05-29 16:22:34 +02:00
|
|
|
const imageField = useMemo(
|
|
|
|
() => fields.find((field) => field.name === "image"),
|
|
|
|
[fields]
|
|
|
|
);
|
2023-04-19 22:44:06 +02:00
|
|
|
|
2023-05-29 16:22:34 +02:00
|
|
|
const imageUrl = useMediaAsset(
|
|
|
|
entry.data.image,
|
|
|
|
collection,
|
|
|
|
imageField,
|
|
|
|
entry
|
|
|
|
);
|
2023-04-19 22:44:06 +02:00
|
|
|
|
2023-05-29 16:22:34 +02:00
|
|
|
return [
|
|
|
|
PageHeader(entry),
|
|
|
|
Section(
|
|
|
|
Container(
|
|
|
|
Row([
|
|
|
|
h(
|
|
|
|
"div",
|
|
|
|
{ className: "col-md-5 mb-5" },
|
|
|
|
h("img", {
|
|
|
|
className: "img-fluid w-75",
|
|
|
|
src: imageUrl,
|
|
|
|
alt: entry.data.name,
|
|
|
|
})
|
|
|
|
),
|
|
|
|
h(
|
|
|
|
"div",
|
|
|
|
{ className: "col-md-7 mb-5" },
|
|
|
|
h("h3", {}, entry.data.name),
|
2023-06-09 20:35:28 +02:00
|
|
|
h("h6", { className: "text-body-secondary" }, entry.data.title),
|
2023-05-29 16:22:34 +02:00
|
|
|
Content(widgetFor("body"))
|
|
|
|
),
|
|
|
|
])
|
|
|
|
)
|
|
|
|
),
|
|
|
|
];
|
2023-04-19 22:44:06 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
export default CantorpreisPreview;
|