import { useRouter } from "next/router"; import React from "react"; import { Image } from "./Image"; import styles from "./ShapesBackground.module.css"; export function ShapesBackground(props: { children: React.ReactNode }) { const router = useRouter(); return ( <>
{routeList.find((el) => router.pathname === el.route)?.shapes() ?? null}
{props.children} ); } const routeList = [ { route: "/", shapes: HomeShapes, }, ]; type ShapeType = | "asterisk" | "circle" | "cross" | "dots" | "hash" | "plus" | "ring" | "triangle" | "waves"; function Shape(props: { shape: ShapeType; className: string }) { return ( ); } function HomeShapes() { return ( <> ); }