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