|
1 | 1 | import { EventNodeInterface, NodeMutatedEvent } from "@/shared/api/graphql/generated/graphql"; |
2 | 2 | import { DateDisplay } from "@/shared/components/display/date-display"; |
3 | 3 |
|
| 4 | +import { ACCOUNT_OBJECT } from "@/config/constants"; |
| 5 | +import { QSP } from "@/config/qsp"; |
4 | 6 | import { NodeLabel } from "@/entities/nodes/object/ui/node-label"; |
5 | 7 | import { PropertyRow } from "@/entities/schema/ui/styled"; |
| 8 | +import { constructPath } from "@/shared/api/rest/fetch"; |
6 | 9 | import { CopyToClipboard } from "@/shared/components/buttons/copy-to-clipboard"; |
| 10 | +import { Link } from "@/shared/components/ui/link"; |
7 | 11 | import { Popover, PopoverContent, PopoverTrigger } from "@/shared/components/ui/popover"; |
8 | 12 | import { TimelineBorder } from "@/shared/components/ui/timeline-border"; |
9 | 13 | import { |
@@ -52,17 +56,50 @@ export const EventDetails = ({ |
52 | 56 | /> |
53 | 57 | <PropertyRow title="Event" value={event} /> |
54 | 58 | <PropertyRow title="Occured at" value={<DateDisplay date={occurred_at} />} /> |
55 | | - {account_id && <PropertyRow title="Account" value={<NodeLabel id={account_id} />} />} |
| 59 | + {account_id && ( |
| 60 | + <PropertyRow |
| 61 | + title="Account" |
| 62 | + value={ |
| 63 | + <Link |
| 64 | + to={constructPath(`/${ACCOUNT_OBJECT}/${account_id}`, [ |
| 65 | + { name: QSP.BRANCH, value: props.branch }, |
| 66 | + ])} |
| 67 | + > |
| 68 | + <NodeLabel id={account_id} /> |
| 69 | + </Link> |
| 70 | + } |
| 71 | + /> |
| 72 | + )} |
56 | 73 | {primary_node?.id && ( |
57 | | - <PropertyRow title="Primary Node" value={<NodeLabel id={primary_node?.id} />} /> |
| 74 | + <PropertyRow |
| 75 | + title="Primary Node" |
| 76 | + value={ |
| 77 | + <Link |
| 78 | + to={constructPath(`/${primary_node.kind}/${primary_node.id}`, [ |
| 79 | + { name: QSP.BRANCH, value: props.branch }, |
| 80 | + ])} |
| 81 | + > |
| 82 | + <NodeLabel id={primary_node.id} /> |
| 83 | + </Link> |
| 84 | + } |
| 85 | + /> |
58 | 86 | )} |
59 | 87 | {!!related_nodes?.length && ( |
60 | 88 | <PropertyRow |
61 | 89 | title="Related Nodes" |
62 | 90 | value={ |
63 | | - <div className="flex items-center gap-1"> |
| 91 | + <div className="flex flex-col items-end gap-1"> |
64 | 92 | {related_nodes.map((node) => { |
65 | | - return <NodeLabel key={node.id} id={node?.id} />; |
| 93 | + return ( |
| 94 | + <Link |
| 95 | + key={node.id} |
| 96 | + to={constructPath(`/${node.kind}/${node.id}`, [ |
| 97 | + { name: QSP.BRANCH, value: props.branch }, |
| 98 | + ])} |
| 99 | + > |
| 100 | + <NodeLabel id={node?.id} /> |
| 101 | + </Link> |
| 102 | + ); |
66 | 103 | })} |
67 | 104 | </div> |
68 | 105 | } |
|
0 commit comments