import ElectionLink from "../../ElectionLink/index.js";
import NavigationChooseState from "../../NavigationChooseState/index.js";
import { prependContext } from "../../../../utils/tracking/index.js";
import classes from './styles.module.scss';
const RigPages = function RigPages(props) {
  const {
    pages,
    tracking
  } = props;
  const {
    drawerPages,
    states
  } = pages;
  if (drawerPages.length < 1 || states.length < 1) return null;
  return <div>
      <div className={classes.pages}>
        {drawerPages.map(page => <div key={page.id} className={classes.link}>
            <ElectionLink to={page.roles[0]} tracking={{
          context: prependContext({
            prefix: tracking?.context,
            context: 'RigPages'
          })
        }}>
              {page.nav.name}
            </ElectionLink>
          </div>)}
      </div>

      <div className={classes.chooseState}>
        <NavigationChooseState size="lg" tracking={tracking} />
      </div>
    </div>;
};
export default RigPages;