|
1
|
import { HttpTypes } from "@medusajs/types" |
|
2
|
import { UIMatch } from "react-router-dom" |
|
3
|
import { useShippingProfile } from "../../../hooks/api/shipping-profiles" |
|
4
|
|
|
5
|
type ShippingProfileDetailBreadcrumbProps = |
|
6
|
UIMatch<HttpTypes.AdminShippingProfileResponse> |
|
7
|
|
|
8
|
export const ShippingProfileDetailBreadcrumb = ( |
|
9
|
props: ShippingProfileDetailBreadcrumbProps |
|
10
|
) => { |
|
11
|
const { shipping_profile_id } = props.params || {} |
|
12
|
|
|
13
|
const { shipping_profile } = useShippingProfile( |
|
14
|
shipping_profile_id!, |
|
15
|
undefined, |
|
16
|
{ |
|
17
|
initialData: props.loaderData, |
|
18
|
enabled: Boolean(shipping_profile_id), |
|
19
|
} |
|
20
|
) |
|
21
|
|
|
22
|
if (!shipping_profile) { |
|
23
|
return null |
|
24
|
} |
|
25
|
|
|
26
|
return <span>{shipping_profile.name}</span> |
|
27
|
} |
|
28
|
|
|
29
|
export const seo = ( |
|
30
|
match: UIMatch<HttpTypes.AdminShippingProfileResponse> |
|
31
|
) => ({ |
|
32
|
title: match.loaderData?.shipping_profile?.name, |
|
33
|
}) |