tambahannnya

This commit is contained in:
bipproduction
2025-02-15 21:56:18 +08:00
parent 00355814bc
commit 2115af8126
84 changed files with 2189 additions and 320 deletions

50
src/com/NavbarSubMenu.tsx Normal file
View File

@@ -0,0 +1,50 @@
"use client";
import stateNav from "@/state/state-nav";
import { Button, Container, Stack } from "@mantine/core";
import { motion } from "motion/react";
import Link from "next/link";
import { MenuItem } from "../../types/menu-item";
import _ from "lodash";
export function NavbarSubMenu({ item }: { item: MenuItem[] | null }) {
return (
<motion.div
key={_.uniqueId()}
initial={{ opacity: 0.5 }}
animate={{ opacity: 1 }}
transition={{ duration: 1 }}
>
<Container
key={stateNav.item?.[0]?.id}
onMouseLeave={() => {
stateNav.item = null;
stateNav.isSearch = false;
}}
w={{
base: "100%",
md: "80%",
}}
fluid
>
<Stack gap={0} align="start" py={"xl"}>
{item &&
item.map((item, k) => {
return (
<Button
fz={"lg"}
color="dark.9"
variant="transparent"
component={Link}
href={item.href}
key={k}
>
{item.name}
</Button>
);
})}
</Stack>
</Container>
</motion.div>
);
}