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.

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

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

import { SingleColumnPage } from "../../components/layout/pages"
import {
  OfferListActions,
  OfferListDataTable,
  OfferListHeader,
  OfferListTable,
  OfferListTitle,
} from "./_components"

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

export const OfferListPage = Object.assign(Root, {
  Table: OfferListTable,
  Header: OfferListHeader,
  HeaderTitle: OfferListTitle,
  HeaderActions: OfferListActions,
  DataTable: OfferListDataTable,
})

export const Component = Root