43 lines
1.3 KiB
JavaScript
43 lines
1.3 KiB
JavaScript
'use client';
|
|
import { Button } from "@mui/material";
|
|
import { useState } from "react"
|
|
|
|
const listLink = [
|
|
{ name: 'درباره پزشک', link: 'about-doctor' },
|
|
{ name: 'موقعیت مکانی ', link: 'location' },
|
|
{ name: 'نظرات', link: 'comments' },
|
|
]
|
|
|
|
function Link() {
|
|
|
|
const [activeId, setActiveId] = useState(0);
|
|
|
|
return (
|
|
<ul className="flex items-center justify-start mt-[56px] mb-[32px]">
|
|
{listLink.map((item, idx) => (
|
|
<li
|
|
key={idx}
|
|
className="flex"
|
|
>
|
|
<a href={`#${item.link}`}>
|
|
<Button
|
|
onClick={() => setActiveId(idx)}
|
|
className={`!text-[20px] !font-bold !p-1
|
|
${activeId === idx ? '!text-[#F17732]' : '!text-[#525252]'}
|
|
`}
|
|
variant="text">
|
|
{item.name}
|
|
</Button>
|
|
</a>
|
|
{listLink.length > idx + 1 && (
|
|
<span
|
|
className="block bg-[#BABABA] w-px h-[38px] lg:mx-[44px] xl:mx-[56px]"
|
|
></span>
|
|
)}
|
|
</li>
|
|
))}
|
|
</ul>
|
|
)
|
|
}
|
|
|
|
export default Link |