diff --git a/pages/o-gractwie.tsx b/pages/o-gractwie.tsx index 8667d78..af60495 100644 --- a/pages/o-gractwie.tsx +++ b/pages/o-gractwie.tsx @@ -4,10 +4,31 @@ import styles from "../styles/oGractwie.module.scss"; import Link from "next/link"; import { Icon } from "../components/Icon"; import { iconselection } from "../components/Icon"; -import administracja from "../data/administracja.json"; import links from "../data/links.json"; +import { useEffect, useState } from "react"; const PageInfo = () => { + const [adminList, setAdminList] = useState([]); + type apiResType = { + Id: string; + Name: string; + Desc: string; + Img: string; + DevBadge: string; + AssignedUser: string; + }; + useEffect(() => { + fetch("https://gractwo.pl/api/v1/admincards") + .then((res) => { + return res.json(); + }) + .then((data) => { + setAdminList(data); + }) + .catch((err) => { + console.log(err); + }); + }, []); return ( <> @@ -48,20 +69,21 @@ const PageInfo = () => {

skład administracji

- {administracja.map((el) => { + {adminList.map((el: apiResType) => { return (
- {`zdjęcie + {`zdjęcie
-

{el.name}

-

{el.desc || "brak opisu."}

- {el.devBadge ? ( +

{el.Name}

+

{el.Desc || "brak opisu."}

+ {el.DevBadge ? ( DEV ) : ( ""