export * from '@digigov/react-core/BreadcrumbsListItemLinkBase';
import React from 'react';
import {
  BreadcrumbsListItemLinkBase,
  BreadcrumbsListItemLinkBaseProps,
} from '@digigov/react-core/BreadcrumbsListItemLinkBase';
import { Link } from '@digigov/ui/navigation/Link';

export interface BreadcrumbsListItemLinkProps
  extends BreadcrumbsListItemLinkBaseProps {
  /*
   * ariaCurrent is used to indicate the current page in the breadcrumbs. It should be set to 'page' for the current page link.
   */
  ariaCurrent?: 'page';
}

export const BreadcrumbsListItemLink = React.forwardRef<
  HTMLAnchorElement,
  BreadcrumbsListItemLinkProps
>(function BreadcrumbsListItemLink({ children, ariaCurrent, ...props }, ref) {
  return (
    <BreadcrumbsListItemLinkBase
      as={Link}
      ref={ref}
      ariaCurrent={ariaCurrent}
      {...props}
    >
      {children}
    </BreadcrumbsListItemLinkBase>
  );
});
export default BreadcrumbsListItemLink;
