import React from 'react' import { Link } from 'gatsby' import dcLogo from '../../images/dclogo.png' import { Container } from '../shared' import { logoStyles, CustomNavBar, ulStyles, Li, StyledLink } from './style' import { pathPrefix } from '../../../gatsby-config' import type { NavibarProps } from '../../types' interface NaviLink { name: string url: string active: 'yes' | 'no' } const naviLinks: NaviLink[] = [ { name: 'Home', url: '/', active: 'no' }, { name: 'About', url: '/about/', active: 'no' }, { name: 'Blog', url: '/blog/', active: 'no' }, { name: 'Feed', url: '/feed/', active: 'no' }, { name: 'FAQ', url: '/faq/', active: 'no' }, { name: 'Docs', url: 'https://docs.datacontroller.io/', active: 'no' }, { name: 'Pricing', url: '/pricing/', active: 'no' }, { name: 'Book Demo', url: '/contact/', active: 'no' }, { name: 'Source Code', url: 'https://git.datacontroller.io/dc/dc', active: 'no' } ] const Navibar: React.FC = ({ location }) => { naviLinks.forEach((link) => (link.active = 'no')) const currentLink = naviLinks.find( (link) => pathPrefix + link.url === location?.pathname ) if (currentLink) currentLink.active = 'yes' return ( Data Controller Logo ) } export default Navibar