@trustless-work/blocks 0.0.7 → 0.0.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (66) hide show
  1. package/bin/index.js +719 -17
  2. package/package.json +1 -1
  3. package/templates/escrows/details/Actions.tsx +144 -149
  4. package/templates/escrows/details/Entities.tsx +1 -1
  5. package/templates/escrows/details/EntityCard.tsx +1 -3
  6. package/templates/escrows/details/EscrowDetailDialog.tsx +16 -16
  7. package/templates/escrows/details/GeneralInformation.tsx +19 -22
  8. package/templates/escrows/details/MilestoneCard.tsx +46 -47
  9. package/templates/escrows/details/MilestoneDetailDialog.tsx +1 -2
  10. package/templates/escrows/details/Milestones.tsx +0 -5
  11. package/templates/escrows/details/SuccessReleaseDialog.tsx +4 -6
  12. package/templates/escrows/escrows-by-role/cards/EscrowsCards.tsx +84 -49
  13. package/templates/escrows/escrows-by-role/cards/Filters.tsx +3 -5
  14. package/templates/escrows/escrows-by-role/table/EscrowsTable.tsx +8 -26
  15. package/templates/escrows/escrows-by-role/table/Filters.tsx +3 -5
  16. package/templates/escrows/escrows-by-signer/cards/EscrowsCards.tsx +89 -55
  17. package/templates/escrows/escrows-by-signer/cards/Filters.tsx +3 -5
  18. package/templates/escrows/escrows-by-signer/table/EscrowsTable.tsx +8 -24
  19. package/templates/escrows/escrows-by-signer/table/Filters.tsx +3 -5
  20. package/templates/escrows/multi-release/dispute-milestone/button/DisputeEscrow.tsx +98 -0
  21. package/templates/escrows/multi-release/initialize-escrow/dialog/InitializeEscrow.tsx +528 -0
  22. package/templates/escrows/multi-release/initialize-escrow/form/InitializeEscrow.tsx +506 -0
  23. package/templates/escrows/multi-release/initialize-escrow/shared/schema.ts +179 -0
  24. package/templates/escrows/multi-release/initialize-escrow/shared/useInitializeEscrow.ts +175 -0
  25. package/templates/escrows/multi-release/release-milestone/button/ReleaseEscrow.tsx +116 -0
  26. package/templates/escrows/multi-release/resolve-dispute/button/ResolveDispute.tsx +122 -0
  27. package/templates/escrows/multi-release/resolve-dispute/dialog/ResolveDispute.tsx +178 -0
  28. package/templates/escrows/multi-release/resolve-dispute/form/ResolveDispute.tsx +156 -0
  29. package/templates/escrows/multi-release/resolve-dispute/shared/schema.ts +85 -0
  30. package/templates/escrows/multi-release/resolve-dispute/shared/useResolveDispute.ts +105 -0
  31. package/templates/escrows/multi-release/update-escrow/dialog/UpdateEscrow.tsx +471 -0
  32. package/templates/escrows/multi-release/update-escrow/form/UpdateEscrow.tsx +449 -0
  33. package/templates/escrows/multi-release/update-escrow/shared/schema.ts +152 -0
  34. package/templates/escrows/multi-release/update-escrow/shared/useUpdateEscrow.ts +254 -0
  35. package/templates/escrows/{single-release → single-multi-release}/approve-milestone/button/ApproveMilestone.tsx +20 -7
  36. package/templates/escrows/{single-release → single-multi-release}/approve-milestone/dialog/ApproveMilestone.tsx +2 -2
  37. package/templates/escrows/{single-release → single-multi-release}/approve-milestone/form/ApproveMilestone.tsx +2 -2
  38. package/templates/escrows/{single-release → single-multi-release}/approve-milestone/shared/useApproveMilestone.ts +16 -16
  39. package/templates/escrows/{single-release → single-multi-release}/change-milestone-status/button/ChangeMilestoneStatus.tsx +4 -4
  40. package/templates/escrows/{single-release → single-multi-release}/change-milestone-status/dialog/ChangeMilestoneStatus.tsx +3 -3
  41. package/templates/escrows/{single-release → single-multi-release}/change-milestone-status/form/ChangeMilestoneStatus.tsx +2 -2
  42. package/templates/escrows/{single-release → single-multi-release}/change-milestone-status/shared/useChangeMilestoneStatus.ts +1 -1
  43. package/templates/escrows/{single-release → single-multi-release}/fund-escrow/button/FundEscrow.tsx +3 -3
  44. package/templates/escrows/{single-release → single-multi-release}/fund-escrow/dialog/FundEscrow.tsx +2 -2
  45. package/templates/escrows/{single-release → single-multi-release}/fund-escrow/form/FundEscrow.tsx +2 -2
  46. package/templates/escrows/{single-release → single-multi-release}/fund-escrow/shared/useFundEscrow.ts +1 -1
  47. package/templates/escrows/single-release/dispute-escrow/button/DisputeEscrow.tsx +2 -2
  48. package/templates/escrows/single-release/initialize-escrow/dialog/InitializeEscrow.tsx +14 -6
  49. package/templates/escrows/single-release/initialize-escrow/form/InitializeEscrow.tsx +14 -6
  50. package/templates/escrows/single-release/initialize-escrow/shared/schema.ts +0 -57
  51. package/templates/escrows/single-release/initialize-escrow/shared/useInitializeEscrow.ts +42 -1
  52. package/templates/escrows/single-release/release-escrow/button/ReleaseEscrow.tsx +2 -2
  53. package/templates/escrows/single-release/resolve-dispute/button/ResolveDispute.tsx +3 -3
  54. package/templates/escrows/single-release/resolve-dispute/dialog/ResolveDispute.tsx +3 -6
  55. package/templates/escrows/single-release/resolve-dispute/form/ResolveDispute.tsx +2 -2
  56. package/templates/escrows/single-release/resolve-dispute/shared/useResolveDispute.ts +14 -1
  57. package/templates/escrows/single-release/update-escrow/dialog/UpdateEscrow.tsx +2 -2
  58. package/templates/escrows/single-release/update-escrow/form/UpdateEscrow.tsx +2 -2
  59. package/templates/escrows/single-release/update-escrow/shared/useUpdateEscrow.ts +12 -7
  60. package/templates/providers/EscrowDialogsProvider.tsx +1 -3
  61. package/templates/providers/EscrowProvider.tsx +27 -4
  62. package/templates/providers/TrustlessWork.tsx +1 -1
  63. package/templates/escrows/details/ProgressEscrow.tsx +0 -191
  64. /package/templates/escrows/{single-release → single-multi-release}/approve-milestone/shared/schema.ts +0 -0
  65. /package/templates/escrows/{single-release → single-multi-release}/change-milestone-status/shared/schema.ts +0 -0
  66. /package/templates/escrows/{single-release → single-multi-release}/fund-escrow/shared/schema.ts +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trustless-work/blocks",
3
- "version": "0.0.7",
3
+ "version": "0.0.9",
4
4
  "author": "Trustless Work",
5
5
  "keywords": [
6
6
  "react",
@@ -1,149 +1,144 @@
1
- import {
2
- DollarSign,
3
- CheckCircle,
4
- CheckSquare,
5
- AlertTriangle,
6
- Edit,
7
- Scale,
8
- Unlock,
9
- Wallet,
10
- Settings,
11
- Briefcase,
12
- } from "lucide-react";
13
- import {
14
- GetEscrowsFromIndexerResponse as Escrow,
15
- Role,
16
- } from "@trustless-work/escrow/types";
17
- import DisputeEscrowButton from "../../single-release/dispute-escrow/button/DisputeEscrow";
18
- import ResolveDisputeDialog from "../../single-release/resolve-dispute/dialog/ResolveDispute";
19
- import ReleaseEscrowButton from "../../single-release/release-escrow/button/ReleaseEscrow";
20
- import FundEscrowDialog from "../../single-release/fund-escrow/dialog/FundEscrow";
21
- import UpdateEscrowDialog from "../../single-release/update-escrow/dialog/UpdateEscrow";
22
-
23
- interface ActionsProps {
24
- selectedEscrow: Escrow;
25
- userRolesInEscrow: string[];
26
- areAllMilestonesApproved: boolean;
27
- activeRole: Role[];
28
- }
29
-
30
- export const roleActions: {
31
- role: Role;
32
- actions: string[];
33
- icon: React.ReactNode;
34
- color: string;
35
- }[] = [
36
- {
37
- role: "signer",
38
- actions: ["fundEscrow"],
39
- icon: <Wallet className="h-6 w-6 text-primary" />,
40
- color: "",
41
- },
42
- {
43
- role: "approver",
44
- actions: ["fundEscrow", "approveMilestone", "startDispute"],
45
- icon: <CheckCircle className="h-6 w-6 text-primary" />,
46
- color: "0",
47
- },
48
- {
49
- role: "serviceProvider",
50
- actions: ["fundEscrow", "completeMilestone", "startDispute"],
51
- icon: <Briefcase className="h-6 w-6 text-primary" />,
52
- color: "0",
53
- },
54
- {
55
- role: "disputeResolver",
56
- actions: ["fundEscrow", "resolveDispute"],
57
- icon: <Scale className="h-6 w-6 text-primary" />,
58
- color: "00",
59
- },
60
- {
61
- role: "releaseSigner",
62
- actions: ["fundEscrow", "releasePayment"],
63
- icon: <Unlock className="h-6 w-6 text-primary" />,
64
- color: "",
65
- },
66
- {
67
- role: "platformAddress",
68
- actions: ["fundEscrow", "editEscrow"],
69
- icon: <Settings className="h-6 w-6 text-primary" />,
70
- color: "0",
71
- },
72
- {
73
- role: "receiver",
74
- actions: ["fundEscrow"],
75
- icon: <DollarSign className="h-6 w-6 text-primary" />,
76
- color: "",
77
- },
78
- ];
79
-
80
- export const actionIcons: Record<string, React.ReactNode> = {
81
- fundEscrow: <DollarSign className="h-6 w-6 text-primary/60" />,
82
- approveMilestone: <CheckCircle className="h-6 w-6 text-primary/60" />,
83
- completeMilestone: <CheckSquare className="h-6 w-6 text-primary/60" />,
84
- startDispute: <AlertTriangle className="h-6 w-6 text-primary/60" />,
85
- resolveDispute: <Scale className="h-6 w-6 text-primary/60" />,
86
- releasePayment: <Unlock className="h-6 w-6 text-primary/60" />,
87
- editEscrow: <Edit className="h-6 w-6 text-primary/60" />,
88
- };
89
-
90
- export const Actions = ({
91
- selectedEscrow,
92
- userRolesInEscrow,
93
- areAllMilestonesApproved,
94
- activeRole,
95
- }: ActionsProps) => {
96
- const shouldShowEditButton =
97
- userRolesInEscrow.includes("platformAddress") &&
98
- !selectedEscrow?.flags?.disputed &&
99
- !selectedEscrow?.flags?.resolved &&
100
- !selectedEscrow?.flags?.released &&
101
- activeRole.includes("platformAddress");
102
-
103
- const shouldShowDisputeButton =
104
- selectedEscrow.type === "single-release" &&
105
- (userRolesInEscrow.includes("approver") ||
106
- userRolesInEscrow.includes("serviceProvider")) &&
107
- (activeRole.includes("approver") ||
108
- activeRole.includes("serviceProvider")) &&
109
- !selectedEscrow?.flags?.disputed &&
110
- !selectedEscrow?.flags?.resolved;
111
-
112
- const shouldShowResolveButton =
113
- selectedEscrow.type === "single-release" &&
114
- userRolesInEscrow.includes("disputeResolver") &&
115
- activeRole.includes("disputeResolver") &&
116
- !selectedEscrow?.flags?.resolved &&
117
- selectedEscrow?.flags?.disputed;
118
-
119
- const shouldShowReleaseFundsButton =
120
- selectedEscrow.type === "single-release" &&
121
- areAllMilestonesApproved &&
122
- userRolesInEscrow.includes("releaseSigner") &&
123
- !selectedEscrow.flags?.released &&
124
- activeRole.includes("releaseSigner");
125
-
126
- const hasConditionalButtons =
127
- shouldShowEditButton ||
128
- shouldShowDisputeButton ||
129
- shouldShowResolveButton ||
130
- shouldShowReleaseFundsButton;
131
-
132
- return (
133
- <div className="flex items-start justify-start flex-col gap-2 w-full">
134
- {hasConditionalButtons && (
135
- <div className="flex flex-col sm:flex-row gap-2 w-full">
136
- {shouldShowEditButton && <UpdateEscrowDialog />}
137
-
138
- {shouldShowDisputeButton && <DisputeEscrowButton />}
139
-
140
- {shouldShowResolveButton && <ResolveDisputeDialog />}
141
-
142
- {shouldShowReleaseFundsButton && <ReleaseEscrowButton />}
143
- </div>
144
- )}
145
-
146
- <FundEscrowDialog />
147
- </div>
148
- );
149
- };
1
+ import {
2
+ DollarSign,
3
+ CheckCircle,
4
+ CheckSquare,
5
+ AlertTriangle,
6
+ Edit,
7
+ Scale,
8
+ Unlock,
9
+ Wallet,
10
+ Settings,
11
+ Briefcase,
12
+ } from "lucide-react";
13
+ import {
14
+ GetEscrowsFromIndexerResponse as Escrow,
15
+ Role,
16
+ } from "@trustless-work/escrow/types";
17
+ import { FundEscrowDialog } from "../../single-multi-release/fund-escrow/dialog/FundEscrow";
18
+
19
+ interface ActionsProps {
20
+ selectedEscrow: Escrow;
21
+ userRolesInEscrow: string[];
22
+ areAllMilestonesApproved: boolean;
23
+ }
24
+
25
+ export const roleActions: {
26
+ role: Role;
27
+ actions: string[];
28
+ icon: React.ReactNode;
29
+ color: string;
30
+ }[] = [
31
+ {
32
+ role: "signer",
33
+ actions: ["fundEscrow"],
34
+ icon: <Wallet className="h-6 w-6 text-primary" />,
35
+ color: "",
36
+ },
37
+ {
38
+ role: "approver",
39
+ actions: ["fundEscrow", "approveMilestone", "startDispute"],
40
+ icon: <CheckCircle className="h-6 w-6 text-primary" />,
41
+ color: "0",
42
+ },
43
+ {
44
+ role: "serviceProvider",
45
+ actions: ["fundEscrow", "completeMilestone", "startDispute"],
46
+ icon: <Briefcase className="h-6 w-6 text-primary" />,
47
+ color: "0",
48
+ },
49
+ {
50
+ role: "disputeResolver",
51
+ actions: ["fundEscrow", "resolveDispute"],
52
+ icon: <Scale className="h-6 w-6 text-primary" />,
53
+ color: "00",
54
+ },
55
+ {
56
+ role: "releaseSigner",
57
+ actions: ["fundEscrow", "releasePayment"],
58
+ icon: <Unlock className="h-6 w-6 text-primary" />,
59
+ color: "",
60
+ },
61
+ {
62
+ role: "platformAddress",
63
+ actions: ["fundEscrow", "editEscrow"],
64
+ icon: <Settings className="h-6 w-6 text-primary" />,
65
+ color: "0",
66
+ },
67
+ {
68
+ role: "receiver",
69
+ actions: ["fundEscrow"],
70
+ icon: <DollarSign className="h-6 w-6 text-primary" />,
71
+ color: "",
72
+ },
73
+ ];
74
+
75
+ export const actionIcons: Record<string, React.ReactNode> = {
76
+ fundEscrow: <DollarSign className="h-6 w-6 text-primary/60" />,
77
+ approveMilestone: <CheckCircle className="h-6 w-6 text-primary/60" />,
78
+ completeMilestone: <CheckSquare className="h-6 w-6 text-primary/60" />,
79
+ startDispute: <AlertTriangle className="h-6 w-6 text-primary/60" />,
80
+ resolveDispute: <Scale className="h-6 w-6 text-primary/60" />,
81
+ releasePayment: <Unlock className="h-6 w-6 text-primary/60" />,
82
+ editEscrow: <Edit className="h-6 w-6 text-primary/60" />,
83
+ };
84
+
85
+ export const Actions = ({
86
+ selectedEscrow,
87
+ userRolesInEscrow,
88
+ areAllMilestonesApproved,
89
+ }: ActionsProps) => {
90
+ const shouldShowEditButton =
91
+ userRolesInEscrow.includes("platformAddress") &&
92
+ !selectedEscrow?.flags?.disputed &&
93
+ !selectedEscrow?.flags?.resolved &&
94
+ !selectedEscrow?.flags?.released &&
95
+ selectedEscrow?.balance === 0;
96
+
97
+ const shouldShowDisputeButton =
98
+ selectedEscrow.type === "single-release" &&
99
+ (userRolesInEscrow.includes("approver") ||
100
+ userRolesInEscrow.includes("serviceProvider")) &&
101
+ !selectedEscrow?.flags?.disputed &&
102
+ !selectedEscrow?.flags?.resolved;
103
+
104
+ const shouldShowResolveButton =
105
+ selectedEscrow.type === "single-release" &&
106
+ userRolesInEscrow.includes("disputeResolver") &&
107
+ !selectedEscrow?.flags?.resolved &&
108
+ selectedEscrow?.flags?.disputed;
109
+
110
+ const shouldShowReleaseFundsButton =
111
+ selectedEscrow.type === "single-release" &&
112
+ areAllMilestonesApproved &&
113
+ userRolesInEscrow.includes("releaseSigner") &&
114
+ !selectedEscrow.flags?.released;
115
+
116
+ const hasConditionalButtons =
117
+ shouldShowEditButton ||
118
+ shouldShowDisputeButton ||
119
+ shouldShowResolveButton ||
120
+ shouldShowReleaseFundsButton;
121
+
122
+ return (
123
+ <div className="flex items-start justify-start flex-col gap-2 w-full">
124
+ {/* You can add the buttons here, using the buttons from the blocks. These actions are conditional based on the escrow flags and the user roles. */}
125
+ {hasConditionalButtons && (
126
+ <div className="flex flex-col gap-2 w-full">
127
+ {/* UpdateEscrowDialog component should be rendered based on the escrow type. It means that if the selectedEscrow.type is "single-release", then the UpdateEscrowDialog (from the single-release block) component should be rendered. If the selectedEscrow.type is "multi-release", then the UpdateEscrowDialog (from the multi-release block) component should be rendered. */}
128
+ {/* {shouldShowEditButton && <UpdateEscrowDialog />} */}
129
+
130
+ {/* Works only with single-release escrows */}
131
+ {/* {shouldShowDisputeButton && <DisputeEscrowButton />} */}
132
+
133
+ {/* Works only with single-release escrows */}
134
+ {/* {shouldShowResolveButton && <ResolveDisputeDialog />} */}
135
+
136
+ {/* Works only with single-release escrows */}
137
+ {/* {shouldShowReleaseFundsButton && <ReleaseEscrowButton />} */}
138
+ </div>
139
+ )}
140
+
141
+ <FundEscrowDialog />
142
+ </div>
143
+ );
144
+ };
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
 
3
3
  import { GetEscrowsFromIndexerResponse as Escrow } from "@trustless-work/escrow/types";
4
- import EntityCard from "./EntityCard";
4
+ import { EntityCard } from "./EntityCard";
5
5
 
6
6
  interface EntitiesProps {
7
7
  selectedEscrow: Escrow;
@@ -22,7 +22,7 @@ interface EntityCardProps {
22
22
  inDispute?: boolean;
23
23
  }
24
24
 
25
- const EntityCard = ({
25
+ export const EntityCard = ({
26
26
  entity,
27
27
  type,
28
28
  hasPercentage,
@@ -94,5 +94,3 @@ const EntityCard = ({
94
94
  </Card>
95
95
  );
96
96
  };
97
-
98
- export default EntityCard;
@@ -13,29 +13,31 @@ import Link from "next/link";
13
13
  import { Card } from "__UI_BASE__/card";
14
14
  import { Info, Users, ListChecks } from "lucide-react";
15
15
  import { useEscrowDialogs } from "@/components/tw-blocks/providers/EscrowDialogsProvider";
16
- import type {
17
- GetEscrowsFromIndexerResponse as Escrow,
18
- Role,
19
- } from "@trustless-work/escrow/types";
16
+ import type { GetEscrowsFromIndexerResponse as Escrow } from "@trustless-work/escrow/types";
20
17
  import { Tabs, TabsContent, TabsList, TabsTrigger } from "__UI_BASE__/tabs";
21
18
  import { Milestones } from "./Milestones";
22
19
  import { Entities } from "./Entities";
23
20
  import { GeneralInformation } from "./GeneralInformation";
24
21
  import { useEscrowContext } from "@/components/tw-blocks/providers/EscrowProvider";
25
- import SuccessReleaseDialog from "./SuccessReleaseDialog";
22
+ import { SuccessReleaseDialog } from "./SuccessReleaseDialog";
23
+
24
+ /**
25
+ * Based on the provided roles -> https://docs.trustlesswork.com/trustless-work/technology-overview/roles-in-trustless-work
26
+ *
27
+ * The roles that the user assigns in the escrow initialization are in the userRolesInEscrow state. Based on these roles, you'll have different actions buttons.
28
+ *
29
+ */
26
30
 
27
31
  interface EscrowDetailDialogProps {
28
32
  isDialogOpen: boolean;
29
- activeRole: Role[];
30
33
  setIsDialogOpen: (value: boolean) => void;
31
34
  setSelectedEscrow: (selectedEscrow?: Escrow) => void;
32
35
  }
33
36
 
34
- const EscrowDetailDialog = ({
37
+ export const EscrowDetailDialog = ({
35
38
  isDialogOpen,
36
39
  setIsDialogOpen,
37
40
  setSelectedEscrow,
38
- activeRole,
39
41
  }: EscrowDetailDialogProps) => {
40
42
  const { selectedEscrow } = useEscrowContext();
41
43
  const dialogStates = useEscrowDialogs();
@@ -115,7 +117,6 @@ const EscrowDetailDialog = ({
115
117
  <div className="flex-1 min-h-0">
116
118
  <TabsContent value="general" className="mt-4 h-full">
117
119
  <GeneralInformation
118
- activeRole={activeRole}
119
120
  selectedEscrow={selectedEscrow}
120
121
  userRolesInEscrow={userRolesInEscrow}
121
122
  dialogStates={dialogStates}
@@ -130,7 +131,6 @@ const EscrowDetailDialog = ({
130
131
  <TabsContent value="milestones" className="mt-4 h-full">
131
132
  <Card className="p-4 h-full">
132
133
  <Milestones
133
- activeRole={activeRole}
134
134
  selectedEscrow={selectedEscrow}
135
135
  userRolesInEscrow={userRolesInEscrow}
136
136
  setEvidenceVisibleMap={setEvidenceVisibleMap}
@@ -143,12 +143,12 @@ const EscrowDetailDialog = ({
143
143
  </DialogContent>
144
144
  </Dialog>
145
145
 
146
- <SuccessReleaseDialog
147
- isOpen={dialogStates.successRelease.isOpen}
148
- onOpenChange={dialogStates.successRelease.setIsOpen}
149
- />
146
+ {dialogStates.successRelease.isOpen && (
147
+ <SuccessReleaseDialog
148
+ isOpen={dialogStates.successRelease.isOpen}
149
+ onOpenChange={dialogStates.successRelease.setIsOpen}
150
+ />
151
+ )}
150
152
  </>
151
153
  );
152
154
  };
153
-
154
- export default React.memo(EscrowDetailDialog);
@@ -2,6 +2,7 @@
2
2
 
3
3
  import React, { useMemo } from "react";
4
4
  import { Card } from "__UI_BASE__/card";
5
+ import { Tooltip, TooltipTrigger, TooltipContent } from "__UI_BASE__/tooltip";
5
6
  import { cn } from "@/lib/utils";
6
7
  import { MultiReleaseMilestone } from "@trustless-work/escrow";
7
8
  import {
@@ -14,30 +15,26 @@ import {
14
15
  Users,
15
16
  Check,
16
17
  Copy,
18
+ BriefcaseBusiness,
19
+ BookOpen,
17
20
  } from "lucide-react";
18
21
  import { Actions, roleActions } from "./Actions";
19
- import type {
20
- DialogStates,
21
- StatusStates,
22
- } from "@/components/tw-blocks/providers/EscrowDialogsProvider";
23
- import {
24
- GetEscrowsFromIndexerResponse,
25
- Role,
26
- } from "@trustless-work/escrow/types";
22
+ import type { DialogStates } from "@/components/tw-blocks/providers/EscrowDialogsProvider";
23
+ import { GetEscrowsFromIndexerResponse } from "@trustless-work/escrow/types";
27
24
  import { useEscrowAmountContext } from "@/components/tw-blocks/providers/EscrowAmountProvider";
28
25
  import { StatisticsCard } from "./StatisticsCard";
29
26
  import {
30
27
  formatAddress,
31
28
  formatCurrency,
29
+ formatRole,
32
30
  } from "@/components/tw-blocks/helpers/format.helper";
33
31
  import { useCopy } from "@/components/tw-blocks/helpers/useCopy";
34
32
 
35
33
  interface GeneralInformationProps {
36
34
  selectedEscrow: GetEscrowsFromIndexerResponse;
37
35
  userRolesInEscrow: string[];
38
- dialogStates: DialogStates & StatusStates;
36
+ dialogStates: DialogStates;
39
37
  areAllMilestonesApproved: boolean;
40
- activeRole: Role[];
41
38
  }
42
39
 
43
40
  export const GeneralInformation = ({
@@ -45,7 +42,6 @@ export const GeneralInformation = ({
45
42
  userRolesInEscrow,
46
43
  dialogStates,
47
44
  areAllMilestonesApproved,
48
- activeRole,
49
45
  }: GeneralInformationProps) => {
50
46
  const { trustlessWorkAmount, receiverAmount, platformFeeAmount } =
51
47
  useEscrowAmountContext();
@@ -117,7 +113,6 @@ export const GeneralInformation = ({
117
113
  selectedEscrow={selectedEscrow}
118
114
  userRolesInEscrow={userRolesInEscrow}
119
115
  areAllMilestonesApproved={areAllMilestonesApproved}
120
- activeRole={activeRole}
121
116
  />
122
117
  </div>
123
118
  </div>
@@ -176,14 +171,16 @@ export const GeneralInformation = ({
176
171
  {userRolesInEscrow.map((role) => {
177
172
  const roleData = roleActions.find((r) => r.role === role);
178
173
  return (
179
- <div
180
- key={role}
181
- className="p-2 bg-primary/10 rounded-md hover:bg-primary/20 transition-colors"
182
- >
183
- {roleData?.icon || (
184
- <Users className="h-4 w-4 text-primary" />
185
- )}
186
- </div>
174
+ <Tooltip key={role}>
175
+ <TooltipTrigger>
176
+ <div className="p-2 bg-primary/10 rounded-md hover:bg-primary/20 transition-colors cursor-pointer">
177
+ {roleData?.icon || (
178
+ <Users className="h-4 w-4 text-primary" />
179
+ )}
180
+ </div>
181
+ </TooltipTrigger>
182
+ <TooltipContent>{formatRole(role)}</TooltipContent>
183
+ </Tooltip>
187
184
  );
188
185
  })}
189
186
  </div>
@@ -205,7 +202,7 @@ export const GeneralInformation = ({
205
202
  <div className="grid grid-cols-1 md:grid-cols-2 gap-4">
206
203
  <div className="p-4 bg-muted/50 rounded-lg border">
207
204
  <div className="flex items-center gap-3 mb-2">
208
- <CircleDollarSign className="h-5 w-5 text-primary flex-shrink-0" />
205
+ <BriefcaseBusiness className="h-5 w-5 text-primary flex-shrink-0" />
209
206
  <span className="text-sm font-medium text-muted-foreground">
210
207
  Engagement ID
211
208
  </span>
@@ -217,7 +214,7 @@ export const GeneralInformation = ({
217
214
 
218
215
  <div className="p-4 bg-muted/50 rounded-lg border">
219
216
  <div className="flex items-center gap-3 mb-2">
220
- <CircleDollarSign className="h-5 w-5 text-primary flex-shrink-0" />
217
+ <BookOpen className="h-5 w-5 text-primary flex-shrink-0" />
221
218
  <span className="text-sm font-medium text-muted-foreground">
222
219
  Type
223
220
  </span>