1 import { HttpTypes } from "@medusajs/types"
2 import { UIMatch } from "react-router-dom"
3
4 import { usePriceList } from "../../../hooks/api"
5
6 type PriceListDetailBreadcrumbProps = UIMatch<HttpTypes.AdminPriceListResponse>
7
8 export const PriceListDetailBreadcrumb = (
9 props: PriceListDetailBreadcrumbProps
10 ) => {
11 const { id } = props.params || {}
12
13 const { price_list } = usePriceList(id!, undefined, {
14 initialData: props.loaderData,
15 enabled: Boolean(id),
16 })
17
18 if (!price_list) {
19 return null
20 }
21
22 return <span>{price_list.title}</span>
23 }
24
25 export const seo = (match: UIMatch<HttpTypes.AdminPriceListResponse>) => ({
26 title: match.loaderData?.price_list?.title,
27 })