import { ExclamationCircle, Spinner } from "@medusajs/icons" import { Container, Text } from "@medusajs/ui" import { useAdminPriceList } from "medusa-react" import { useTranslation } from "react-i18next" import { useParams } from "react-router-dom" import Spacer from "../../../components/atoms/spacer" import WidgetContainer from "../../../components/extensions/widget-container" import { useWidgets } from "../../../providers/widget-provider" import { PriceListGeneralSection } from "./details" import { PriceListPricesSection } from "./prices" const PriceListEdit = () => { const { id } = useParams<{ id: string }>() const { t } = useTranslation() const { getWidgets } = useWidgets() const { price_list, isLoading, isError } = useAdminPriceList(id!, { enabled: !!id, }) if (isLoading) { return ( ) } if (isError || !price_list) { return (
{t( "price-list-edit-error", "An error occurred while loading price list. Reload the page and try again. If the issue persists, try again later." )}
) } return ( <>
{getWidgets("price_list.details.before").map((w, i) => { return ( ) })} {getWidgets("price_list.details.after").map((w, i) => { return ( ) })}
) } export { PriceListEdit }