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