gcg-website/static/admin/previews/page-previews/abiturienten-preview.js

32 lines
625 B
JavaScript
Raw Permalink Normal View History

import {
Container,
PageHeader,
Section,
ContentJustify,
} 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-05-29 16:22:34 +02:00
const imageUrl = useMediaAsset(
entry.data.image,
collection,
imageField,
entry
);
return [
PageHeader(entry),
Section(
Container([
h("img", { className: "img-fluid w-100 mb-4", src: imageUrl }),
ContentJustify(widgetFor("body")),
])
2023-05-29 16:22:34 +02:00
),
];
};
export default AbiturientenPreview;