1 import React from "react"
2 import { InlineCode } from "../../../InlineCode"
3 import { Text } from "@medusajs/ui"
4 import { Bolt, CursorArrowRays, InformationCircle } from "@medusajs/icons"
5
6 type WorkflowDiagramLegendProps = {
7 hideLegend?: boolean
8 }
9
10 export const WorkflowDiagramLegend = ({
11 hideLegend = false,
12 }: WorkflowDiagramLegendProps) => {
13 return (
14 <div className="flex gap-docs_0.5">
15 {!hideLegend && (
16 <>
17 <div className="flex items-center gap-docs_0.5">
18 <div className="flex size-[20px] items-center justify-center text-medusa-tag-orange-icon">
19 <Bolt />
20 </div>
21 <Text
22 size="xsmall"
23 leading="compact"
24 weight="plus"
25 className="select-none"
26 >
27 Workflow hook
28 </Text>
29 </div>
30 <div className="flex items-center gap-docs_0.5">
31 <div className="flex size-[20px] items-center justify-center text-medusa-tag-green-icon">
32 <InformationCircle />
33 </div>
34 <Text
35 size="xsmall"
36 leading="compact"
37 weight="plus"
38 className="select-none"
39 >
40 Step conditioned by <InlineCode>when</InlineCode>
41 </Text>
42 </div>
43 </>
44 )}
45 <div className="flex items-center gap-docs_0.5">
46 <div className="flex size-[20px] items-center justify-center">
47 <CursorArrowRays />
48 </div>
49 <Text
50 size="xsmall"
51 leading="compact"
52 weight="plus"
53 className="select-none"
54 >
55 View step details
56 </Text>
57 </div>
58 </div>
59 )
60 }