mirror of
https://github.com/karl0ss/homepage.git
synced 2025-04-29 12:03:41 +01:00

will be useful going forward, and simplify widget props being passed around all over the place
31 lines
876 B
JavaScript
31 lines
876 B
JavaScript
import classNames from "classnames";
|
|
|
|
import Item from "components/services/item";
|
|
|
|
const columnMap = [
|
|
"grid-cols-1 md:grid-cols-1 lg:grid-cols-1",
|
|
"grid-cols-1 md:grid-cols-1 lg:grid-cols-1",
|
|
"grid-cols-1 md:grid-cols-2 lg:grid-cols-2",
|
|
"grid-cols-1 md:grid-cols-2 lg:grid-cols-3",
|
|
"grid-cols-1 md:grid-cols-2 lg:grid-cols-4",
|
|
"grid-cols-1 md:grid-cols-2 lg:grid-cols-5",
|
|
"grid-cols-1 md:grid-cols-2 lg:grid-cols-6",
|
|
"grid-cols-1 md:grid-cols-2 lg:grid-cols-7",
|
|
"grid-cols-1 md:grid-cols-2 lg:grid-cols-8",
|
|
];
|
|
|
|
export default function List({ services, layout }) {
|
|
return (
|
|
<ul
|
|
className={classNames(
|
|
layout?.style === "row" ? `grid ${columnMap[layout?.columns]} gap-x-2` : "flex flex-col",
|
|
"mt-3"
|
|
)}
|
|
>
|
|
{services.map((service) => (
|
|
<Item key={service.name} service={service} />
|
|
))}
|
|
</ul>
|
|
);
|
|
}
|