2024-09-16 21:34:24 +02:00
|
|
|
import { Container, ContentJustify, PageHeader, Row } from "./components/index.js";
|
2023-04-19 22:44:06 +02:00
|
|
|
|
2024-09-16 21:34:24 +02:00
|
|
|
const ProjektwochePreview = ({ widgetsFor, widgetFor, entry, collection, fields }) => {
|
|
|
|
const imageField = useMemo(() => fields.find((field) => field.name === "image"), [fields]);
|
2023-05-29 16:22:34 +02:00
|
|
|
return [
|
|
|
|
PageHeader(entry),
|
2023-07-31 20:54:52 +02:00
|
|
|
h(
|
|
|
|
"section",
|
|
|
|
{ className: "section superhaufen" },
|
|
|
|
Container(ContentJustify(widgetFor("body"))),
|
2023-05-29 16:22:34 +02:00
|
|
|
Container(
|
|
|
|
Row([
|
|
|
|
widgetsFor("tiles").map((tile) =>
|
|
|
|
h(
|
|
|
|
"div",
|
|
|
|
{ className: "col-lg-4 col-sm-6" },
|
|
|
|
h(
|
|
|
|
"div",
|
|
|
|
{
|
|
|
|
className: "card border-primary rounded-0 hover-shadow mb-4",
|
|
|
|
},
|
2024-09-16 21:34:24 +02:00
|
|
|
tile.data.image && tile.data.image != "" && tile.data.image != "/media/image.webp"
|
|
|
|
? h("img", {
|
|
|
|
className: "card-img-top rounded-0",
|
|
|
|
src: useMediaAsset(tile.data.image, collection, imageField, entry),
|
|
|
|
})
|
|
|
|
: h(
|
|
|
|
"div",
|
|
|
|
{
|
|
|
|
className: "container fb-tile-color",
|
|
|
|
style: { backgroundColor: tile.data.bg_color },
|
|
|
|
},
|
|
|
|
h("i", {
|
|
|
|
className: (tile.data.icon ?? "") + " fb-tile-icon",
|
|
|
|
style: { color: tile.data.font_color },
|
|
|
|
})
|
|
|
|
),
|
2023-05-29 16:22:34 +02:00
|
|
|
h(
|
|
|
|
"div",
|
|
|
|
{ className: "card-body" },
|
2024-09-16 21:34:24 +02:00
|
|
|
h("h4", { className: "card-title text-truncate" }, tile.data.title),
|
|
|
|
h("button", { type: "button", className: "btn btn-primary btn-sm" }, "Mehr anzeigen")
|
2023-05-29 16:22:34 +02:00
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
),
|
|
|
|
])
|
2023-07-31 20:54:52 +02:00
|
|
|
)
|
|
|
|
),
|
2023-05-29 16:22:34 +02:00
|
|
|
];
|
2023-04-19 22:44:06 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
export default ProjektwochePreview;
|