import { Button, Heading, toast } from "@medusajs/ui" import { RouteDrawer, useRouteModal } from "../../../components/modals" import { useTranslation } from "react-i18next" import { ExportFilters } from "./components/export-filters" import { useExportProducts } from "../../../hooks/api" import { useProductTableQuery } from "../../../hooks/table/query" export const ProductExport = () => { const { t } = useTranslation() return ( {t("products.export.header")} {t("products.export.description")} ) } const ProductExportContent = () => { const { t } = useTranslation() const { searchParams } = useProductTableQuery({ prefix: "p" }) delete searchParams.fields const { mutateAsync } = useExportProducts() const { handleSuccess } = useRouteModal() const handleExportRequest = async () => { await mutateAsync( { payload: {}, query: searchParams, }, { onSuccess: () => { toast.info(t("products.export.success.title"), { description: t("products.export.success.description"), }) handleSuccess() }, onError: (err) => { toast.error(err.message) }, } ) } return ( <> {/* */}
) }