2023-07-31 20:54:52 +02:00
|
|
|
import {
|
|
|
|
Container,
|
|
|
|
ContentJustify,
|
|
|
|
PageHeader,
|
|
|
|
Row,
|
|
|
|
Section,
|
|
|
|
} from "./components/index.js";
|
2023-04-19 22:44:06 +02:00
|
|
|
|
|
|
|
const AboutPreview = ({ widgetFor, widgetsFor, 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
|
|
|
|
);
|
|
|
|
return [
|
|
|
|
PageHeader(entry),
|
2023-07-31 20:54:52 +02:00
|
|
|
Section(
|
|
|
|
Container([
|
|
|
|
h("img", { className: "img-fluid w-100 mb-4", src: imageUrl }),
|
|
|
|
ContentJustify(widgetFor("body")),
|
|
|
|
])
|
2023-05-29 16:22:34 +02:00
|
|
|
),
|
|
|
|
entry.data.stats.enable
|
|
|
|
? h(
|
|
|
|
"section",
|
2023-06-11 21:13:11 +02:00
|
|
|
{ className: "section bg-primary" },
|
2023-07-31 20:54:52 +02:00
|
|
|
Container(
|
|
|
|
Row(
|
2023-05-29 16:22:34 +02:00
|
|
|
widgetsFor("stats").data.zahlen.map((element) => {
|
|
|
|
return h(
|
|
|
|
"div",
|
|
|
|
{ className: "col-md-4 col-sm-6 mb-4 mb-md-0" },
|
|
|
|
h(
|
|
|
|
"div",
|
|
|
|
{ className: "text-center" },
|
2024-10-23 21:57:59 +02:00
|
|
|
h("h2", { className: "count text-secondary" }, element.count),
|
|
|
|
h("h5", { className: "text-secondary" }, element.name)
|
2023-05-29 16:22:34 +02:00
|
|
|
)
|
|
|
|
);
|
|
|
|
})
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
: null,
|
|
|
|
];
|
2023-04-19 22:44:06 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
export default AboutPreview;
|