import { Button, Heading, toast } from "@medusajs/ui" import { useTranslation } from "react-i18next" import { RouteDrawer, useRouteModal } from "../../../components/modals" import { useExportOrders } from "../../../hooks/api" import { useOrderTableQuery } from "../../../hooks/table/query" import { ExportFilters } from "./components/export-filters" export const OrderExport = () => { const { t } = useTranslation() return ( {t("orders.export.header")} {t("orders.export.description")} ) } const OrderExportContent = () => { const { t } = useTranslation() const { searchParams } = useOrderTableQuery({}) const { mutateAsync } = useExportOrders(searchParams) const { handleSuccess } = useRouteModal() const handleExportRequest = async () => { await mutateAsync(searchParams, { onSuccess: () => { toast.info(t("orders.export.success.title"), { description: t("orders.export.success.description"), }) handleSuccess() }, onError: (err) => { toast.error(err.message) }, }) } return ( <> {t("actions.cancel")} {t("actions.export")} > ) }