Skip to content

The complete open source platform to run your entire marketplace. Storefront, vendor panel, admin console, and integrations in one enterprise-grade platform you own.

906 B
Raw Blame
import { Children, ReactNode } from "react"

import { WidgetZone } from "@mercurjs/dashboard-shared"

import { SingleColumnPage } from "../../../components/layout/pages"
import {
  PromotionListTable,
  PromotionListHeader,
  PromotionListTitle,
  PromotionListActions,
  PromotionListCreateButton,
  PromotionListDataTable,
} from "./components/promotion-list-table"

const Root = ({ children }: { children?: ReactNode }) => {
  return (
    <SingleColumnPage>
      <WidgetZone id="promotions.list">
        {Children.count(children) > 0 ? children : <PromotionListTable />}
      </WidgetZone>
    </SingleColumnPage>
  )
}

export const PromotionListPage = Object.assign(Root, {
  Table: PromotionListTable,
  Header: PromotionListHeader,
  HeaderTitle: PromotionListTitle,
  HeaderActions: PromotionListActions,
  HeaderCreateButton: PromotionListCreateButton,
  DataTable: PromotionListDataTable,
})