/* global React */
const { useState } = React;
function NavIcon({ name, size = 17 }) {
const s = {
width: size,
height: size,
stroke: "currentColor",
fill: "none",
strokeWidth: 1.67,
strokeLinecap: "round",
strokeLinejoin: "round",
};
if (name === "search")
return (
);
if (name === "chevron")
return (
);
if (name === "caret")
return (
);
if (name === "globe")
return (
);
if (name === "user")
return (
);
if (name === "close")
return (
);
if (name === "menu")
return (
);
return null;
}
const NAV_ITEMS = [
{ id: "home", label: "홈", href: "#/" },
{
id: "food",
label: "맛집-핫플",
href: "#/맛집/우정",
items: [
{
label: "맛집",
href: "#/맛집/우정",
icon: (
),
},
{
label: "카페",
href: "#/맛집/카페",
icon: (
),
},
{
label: "구역근처 명소",
href: "#/맛집/구역내명소",
icon: (
),
},
{
label: "구역외 명소",
href: "#/맛집/추천관광",
icon: (
),
},
],
},
{
id: "news",
label: "안내",
href: "#/안내/정보2",
items: [
{
label: "의료 정보",
href: "#/안내/정보2",
icon: (
),
},
],
},
];
function Nav() {
const [openKey, setOpenKey] = useState(null);
const [mobile, setMobile] = useState(false);
const [expandedId, setExpandedId] = useState(null);
const openMobileMenu = () => {
setExpandedId(null);
setMobile(true);
};
const closeMobileMenu = () => {
setMobile(false);
setExpandedId(null);
};
const toggleExpand = (id) =>
setExpandedId((prev) => (prev === id ? null : id));
return (
<>