import { PencilSquare } from "@medusajs/icons" import { AdminStore } from "@medusajs/types" import { Badge, Container, Heading, Text } from "@medusajs/ui" import { useTranslation } from "react-i18next" import { Link } from "react-router-dom" import { ActionMenu } from "../../../../../components/common/action-menu" import { useSalesChannel, useStockLocation } from "../../../../../hooks/api" import { useRegion } from "../../../../../hooks/api/regions" type StoreGeneralSectionProps = { store: AdminStore } export const StoreGeneralSection = ({ store }: StoreGeneralSectionProps) => { const { t } = useTranslation() const { region } = useRegion(store.default_region_id!, undefined, { enabled: !!store.default_region_id, }) const defaultCurrency = store.supported_currencies?.find((c) => c.is_default) const { sales_channel } = useSalesChannel(store.default_sales_channel_id!, { enabled: !!store.default_sales_channel_id, }) const { stock_location } = useStockLocation( store.default_location_id!, { fields: "id,name", }, { enabled: !!store.default_location_id, } ) return (
{t("store.domain")} {t("store.manageYourStoresDetails")}
, label: t("actions.edit"), to: "edit", }, ], }, ]} />
{t("fields.name")} {store.name}
{t("store.defaultCurrency")} {defaultCurrency ? (
{defaultCurrency.currency_code?.toUpperCase()} {defaultCurrency.currency?.name}
) : ( - )}
{t("store.defaultRegion")}
{region ? ( {region.name} ) : ( - )}
{t("store.defaultSalesChannel")}
{sales_channel ? ( {sales_channel.name} ) : ( - )}
{t("store.defaultLocation")}
{stock_location ? ( {stock_location.name} ) : ( - )}
) }