2023-04-19 22:44:06 +02:00
|
|
|
import { Container, PageHeader, Section, Row } from "./components/index.js";
|
|
|
|
|
|
|
|
const AbiturientenPreview = ({ widgetFor, entry, collection, fields }) => {
|
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
|
|
|
|
);
|
|
|
|
return [
|
|
|
|
PageHeader(entry),
|
|
|
|
Section(
|
|
|
|
Container(
|
|
|
|
Row([
|
|
|
|
h(
|
|
|
|
"div",
|
|
|
|
{ className: "col-12 mb-4" },
|
|
|
|
h("img", { className: "img-fluid w-100", src: imageUrl })
|
|
|
|
),
|
|
|
|
h("div", { className: "col-12 content" }, widgetFor("body")),
|
|
|
|
])
|
|
|
|
)
|
|
|
|
),
|
|
|
|
];
|
2023-04-19 22:44:06 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
export default AbiturientenPreview;
|