import React from "react";

import { ButtonProps } from "@bigbinary/neeto-atoms";

interface NavLinkProps {
  activeClassName?: string;
  disabled?: boolean;
  exact?: boolean;
}

type TooltipPropType = { content: string; position: string };
type HomeButtonPropType = { tooltip: TooltipPropType; icon: React.ReactNode };

type MenuItemPropType = {
  key: string;
  label: string;
  onClick?: () => void;
  disabled?: boolean;
  isDisabled?: boolean;
  tooltipProps?: { content: string };
};

type MoreOptionsPropType = {
  isVertical?: boolean;
  dropdownButtonProps?: { size?: string; className?: string };
  menuItems?: MenuItemPropType[];
};

type HeaderLinkPropType = {
  key: string;
  to: string;
  label: string;
  className?: string;
  labelProps?: Record<string, unknown>;
  moreOptions?: MoreOptionsPropType;
} & NavLinkProps;

type RightActionBlockPropTypes = {
  isDraftBlockHidden?: boolean;
  previewDraftUrl?: string;
  isResetDraftButtonVisible?: boolean;
  onResetClick?: () => void;
  isResetting?: boolean;
  isPublishDisabled?: boolean;
  isPublishing?: boolean;
  handlePublish?: () => void;
  isPublishPreviewDisabled?: boolean;
  previewPublishedUrl?: string;
  isPublishButtonVisible?: boolean;
  isResetAlertOpen?: boolean;
  setIsResetAlertOpen?: (open: boolean) => void;
  handleReset?: () => void;
  publishAlertTitle?: string;
  publishAlertDescription?: string;
  publishButtonProps?: ButtonProps;
};

type NavigationLinkPropsType = {
  headerLinks: HeaderLinkPropType[];
  maxVisibleLinks?: number;
};

type LeftBlockPropTypes = {
  homeButtonProps?: HomeButtonPropType;
  homeUrl: string;
  renameProps?: Record<string, unknown>;
  children?: React.ReactNode;
};

const NavigationHeader: React.FC<{
  leftActionBlock?: React.ReactNode;
  navigationLinks?: React.ReactNode;
  rightActionBlock?: React.ReactNode;
}> & {
  RightActionBlock: React.FC<RightActionBlockPropTypes>;
  NavigationLinks: React.FC<NavigationLinkPropsType>;
  LeftActionBlock: React.FC<LeftBlockPropTypes>;
};

export default NavigationHeader;
