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