/**
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 *
 * Modified by David Garcia for Finboot.
 * 
 * Modifications:
 * - Add site title to the home breadcrumb.
 */

import React from 'react';
import Link from '@docusaurus/Link';
import useBaseUrl from '@docusaurus/useBaseUrl';
import {translate} from '@docusaurus/Translate';
import IconHome from '@theme/Icon/Home';
import useDocusaurusContext from '@docusaurus/useDocusaurusContext';

import styles from './styles.module.css';

export default function HomeBreadcrumbItem(): JSX.Element {
  const homeHref = "https://docs.marco.finboot.com";
  const projectsHref = useBaseUrl('/');
  const {
    siteConfig: {title},
  } = useDocusaurusContext();

  return (
    <>
    <li className="breadcrumbs__item">
      <Link
        aria-label={translate({
          id: 'theme.docs.breadcrumbs.home',
          message: 'Home page',
          description: 'The ARIA label for the home page in the breadcrumbs',
        })}
        className="breadcrumbs__link"
        href={homeHref}
        target="_self">
        <IconHome className={styles.breadcrumbHomeIcon} />
        <span>MARCO docs</span>
      </Link>
    </li>
    <li className="breadcrumbs__item">
      <Link
        aria-label={translate({
          id: 'theme.docs.breadcrumbs.project',
          message: 'Project',
          description: 'The ARIA label for the project page in the breadcrumbs',
        })}
        className="breadcrumbs__link"
        href={projectsHref}>
        <span>{title}</span>
      </Link>
    </li>
    </>
  );
}
