All files / src/componentsV2/SideMenu/hooks/menus merchantMenu.tsx

66.66% Statements 2/3
50% Branches 1/2
50% Functions 1/2
50% Lines 1/2

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111                                        12x                                                                                                                                                                                    
import {
  ArrowsLeftRightIcon,
  UsersIcon,
  GearSixIcon,
  CalendarBlankIcon,
  SealCheckIcon,
  TicketIcon,
  PlusSquareIcon,
  CodeIcon,
  QuestionIcon,
} from "@phosphor-icons/react";
import ChartBarBox from "@assets/iconsV2/ChartBarBox";
import DonationBox from "@assets/iconsV2/DonationBox";
import FileDollar from "@assets/iconsV2/FileDollar";
import ProductSidePanelIcon from "@assets/iconsV2/ProductSidePanelIcon";
 
type Props = {
  isAddProductAllowed: boolean;
};
 
const getMerchantMenu = ({ isAddProductAllowed }: Props) => ({
  menu: [
    {
      label: "Dashboard",
      value: "/merchant/dashboard",
      CustomIcon: <ChartBarBox fill="currentColor" />,
    },
    {
      label: "Manage money",
      value: "/merchant/manage-money",
      Icon: ArrowsLeftRightIcon,
    },
    {
      label: "Customers",
      value: "/merchant/customers",
      Icon: UsersIcon,
    },
    {
      label: "Developer",
      value: `/merchant/developer`,
      Icon: CodeIcon,
    },
    {
      value: "",
      type: "divider",
    },
    {
      label: "Fundraisers",
      value: "/merchant/fundraisers",
      CustomIcon: <DonationBox fill="currentColor" />,
      isForm: true,
    },
    {
      label: "Events",
      value: "/merchant/events",
      Icon: CalendarBlankIcon,
      isForm: true,
    },
    {
      label: "Products",
      value: "/merchant/products",
      CustomIcon: <ProductSidePanelIcon fill="currentColor" />,
      isForm: true,
      name: "standards",
    },
    {
      label: "Invoices",
      value: "/merchant/invoices",
      CustomIcon: <FileDollar fill="currentColor" />,
      isForm: true,
    },
    {
      label: "Memberships",
      value: "/merchant/memberships",
      Icon: SealCheckIcon,
      isForm: true,
    },
    {
      label: "Sweepstakes",
      value: "/merchant/sweepstakes",
      Icon: TicketIcon,
      isForm: true,
    },
    ...(isAddProductAllowed
      ? [
          {
            label: "New Payment Form",
            value: "new-form",
            Icon: PlusSquareIcon,
          },
        ]
      : []),
  ],
  footer: [
    {
      label: "Support",
      value: "support",
      customOnClick: () =>
        window.open(process.env.VITE_MERCHANT_SUPPORT, "_blank"),
      Icon: QuestionIcon,
    },
    {
      label: "Settings",
      value: "/merchant/settings",
      Icon: GearSixIcon,
    },
  ],
});
 
export default getMerchantMenu;