braid-ui 1.0.2 → 1.0.4

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.
package/dist/index.js CHANGED
@@ -1,12 +1,12 @@
1
1
  import * as React13 from 'react';
2
- import { useState, useEffect, useCallback } from 'react';
3
- import { createPortal } from 'react-dom';
4
- import { Slot } from '@radix-ui/react-slot';
2
+ import { useState, useEffect, useCallback, useMemo } from 'react';
5
3
  import { cva } from 'class-variance-authority';
6
4
  import { clsx } from 'clsx';
7
5
  import { twMerge } from 'tailwind-merge';
8
6
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
9
- import { ChevronDown, ChevronUp, Check, X, PanelLeft, Edit, Home, Globe, CreditCard, Building, MoreVertical, Minus, TrendingDown, TrendingUp, ChevronRight, Eye, Trash2, Upload, FileText, Download, Plus, MessageSquare, Copy, LayoutDashboard, Bell, Briefcase, FileCheck, Receipt, ArrowLeftRight, Users, Building2, Zap, Shield, AlertCircle, RefreshCw, Landmark, Search, Repeat, Box, Settings, BarChart3, Key, Heart, User, AlertTriangle, XCircle, CheckCircle, Clock, Filter, ChevronLeft, Calendar as Calendar$1, CheckCircle2, Circle, UserPlus, ChevronsUpDown } from 'lucide-react';
7
+ import { Slot } from '@radix-ui/react-slot';
8
+ import { ChevronDown, ChevronUp, Check, X, PanelLeft, Edit, Home, Globe, CreditCard, Building, MoreVertical, Minus, TrendingDown, TrendingUp, ChevronRight, Eye, Trash2, Plus, MessageSquare, Upload, FileText, Download, Copy, LayoutDashboard, Bell, Briefcase, FileCheck, Receipt, ArrowLeftRight, Users, Building2, Zap, Shield, AlertCircle, RefreshCw, Landmark, Search, Repeat, Box, Settings, BarChart3, Key, Heart, User, AlertTriangle, XCircle, CheckCircle, Clock, Filter, ChevronLeft, Calendar as Calendar$1, CalendarIcon, CheckCircle2, Circle, UserPlus, ChevronsUpDown } from 'lucide-react';
9
+ import { createPortal } from 'react-dom';
10
10
  import * as SelectPrimitive from '@radix-ui/react-select';
11
11
  import * as DialogPrimitive from '@radix-ui/react-dialog';
12
12
  import { NavLink, useLocation, useParams, useNavigate } from 'react-router-dom';
@@ -26,10 +26,218 @@ import * as TabsPrimitive from '@radix-ui/react-tabs';
26
26
  import * as ToastPrimitives from '@radix-ui/react-toast';
27
27
  import { format } from 'date-fns';
28
28
 
29
- // src/components/alerts/AlertDocuments.tsx
29
+ // src/components/ui/form-card.tsx
30
30
  function cn(...inputs) {
31
31
  return twMerge(clsx(inputs));
32
32
  }
33
+ var cardVariants = cva(
34
+ "rounded-lg border bg-card text-card-foreground transition-all duration-200",
35
+ {
36
+ variants: {
37
+ variant: {
38
+ default: "shadow-sm",
39
+ elevated: "shadow-md hover:shadow-lg",
40
+ outlined: "border-2 shadow-none",
41
+ ghost: "border-transparent shadow-none bg-transparent",
42
+ subtle: "border-border/75 shadow-none"
43
+ },
44
+ size: {
45
+ sm: "p-3",
46
+ md: "p-4",
47
+ lg: "p-6",
48
+ none: "p-0"
49
+ },
50
+ fullHeight: {
51
+ true: "h-full flex flex-col",
52
+ false: ""
53
+ },
54
+ interactive: {
55
+ true: "cursor-pointer hover:shadow-md hover:scale-[1.02]",
56
+ false: ""
57
+ }
58
+ },
59
+ defaultVariants: {
60
+ variant: "default",
61
+ size: "none",
62
+ fullHeight: false,
63
+ interactive: false
64
+ }
65
+ }
66
+ );
67
+ var Card = React13.forwardRef(
68
+ ({ className, variant, size, fullHeight, interactive, ...props }, ref) => /* @__PURE__ */ jsx(
69
+ "div",
70
+ {
71
+ ref,
72
+ className: cn(cardVariants({ variant, size, fullHeight, interactive }), className),
73
+ ...props
74
+ }
75
+ )
76
+ );
77
+ Card.displayName = "Card";
78
+ var cardHeaderVariants = cva(
79
+ "flex flex-col space-y-1.5",
80
+ {
81
+ variants: {
82
+ size: {
83
+ sm: "px-3 pt-3 pb-2",
84
+ md: "px-4 pt-4 pb-3",
85
+ lg: "px-6 pt-6 pb-4"
86
+ },
87
+ align: {
88
+ start: "items-start",
89
+ center: "items-center",
90
+ end: "items-end"
91
+ },
92
+ direction: {
93
+ row: "flex-row justify-between items-center space-y-0 space-x-4",
94
+ column: "flex-col space-y-1.5"
95
+ }
96
+ },
97
+ defaultVariants: {
98
+ size: "lg",
99
+ align: "start",
100
+ direction: "column"
101
+ }
102
+ }
103
+ );
104
+ var CardHeader = React13.forwardRef(
105
+ ({ className, size, align, direction, ...props }, ref) => /* @__PURE__ */ jsx(
106
+ "div",
107
+ {
108
+ ref,
109
+ className: cn(cardHeaderVariants({ size, align, direction }), className),
110
+ ...props
111
+ }
112
+ )
113
+ );
114
+ CardHeader.displayName = "CardHeader";
115
+ var cardTitleVariants = cva(
116
+ "font-semibold leading-none tracking-tight",
117
+ {
118
+ variants: {
119
+ size: {
120
+ sm: "text-base",
121
+ md: "text-lg",
122
+ lg: "text-xl"
123
+ }
124
+ },
125
+ defaultVariants: {
126
+ size: "md"
127
+ }
128
+ }
129
+ );
130
+ var CardTitle = React13.forwardRef(
131
+ ({ className, size, ...props }, ref) => /* @__PURE__ */ jsx(
132
+ "h3",
133
+ {
134
+ ref,
135
+ className: cn(cardTitleVariants({ size }), className),
136
+ ...props
137
+ }
138
+ )
139
+ );
140
+ CardTitle.displayName = "CardTitle";
141
+ var CardDescription = React13.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
142
+ "p",
143
+ {
144
+ ref,
145
+ className: cn("text-sm text-muted-foreground", className),
146
+ ...props
147
+ }
148
+ ));
149
+ CardDescription.displayName = "CardDescription";
150
+ var cardContentVariants = cva(
151
+ "",
152
+ {
153
+ variants: {
154
+ size: {
155
+ sm: "px-3 pb-2",
156
+ md: "px-4 pb-3",
157
+ lg: "px-6 pb-4"
158
+ },
159
+ fullHeight: {
160
+ true: "flex-1",
161
+ false: ""
162
+ }
163
+ },
164
+ defaultVariants: {
165
+ size: "lg",
166
+ fullHeight: false
167
+ }
168
+ }
169
+ );
170
+ var CardContent = React13.forwardRef(
171
+ ({ className, size, fullHeight, ...props }, ref) => /* @__PURE__ */ jsx(
172
+ "div",
173
+ {
174
+ ref,
175
+ className: cn(cardContentVariants({ size, fullHeight }), className),
176
+ ...props
177
+ }
178
+ )
179
+ );
180
+ CardContent.displayName = "CardContent";
181
+ var cardFooterVariants = cva(
182
+ "flex items-center pt-0",
183
+ {
184
+ variants: {
185
+ size: {
186
+ sm: "p-3 pt-0",
187
+ md: "p-4 pt-0",
188
+ lg: "p-6 pt-0"
189
+ },
190
+ justify: {
191
+ start: "justify-start",
192
+ center: "justify-center",
193
+ end: "justify-end",
194
+ between: "justify-between"
195
+ }
196
+ },
197
+ defaultVariants: {
198
+ size: "lg",
199
+ justify: "start"
200
+ }
201
+ }
202
+ );
203
+ var CardFooter = React13.forwardRef(
204
+ ({ className, size, justify, ...props }, ref) => /* @__PURE__ */ jsx(
205
+ "div",
206
+ {
207
+ ref,
208
+ className: cn(cardFooterVariants({ size, justify }), className),
209
+ ...props
210
+ }
211
+ )
212
+ );
213
+ CardFooter.displayName = "CardFooter";
214
+ var FormCard = React13.forwardRef(
215
+ ({ title, description, children, headerActions, className, variant = "default", ...props }, ref) => /* @__PURE__ */ jsxs(
216
+ Card,
217
+ {
218
+ ref,
219
+ variant,
220
+ fullHeight: true,
221
+ className: cn("", className),
222
+ ...props,
223
+ children: [
224
+ /* @__PURE__ */ jsxs(
225
+ CardHeader,
226
+ {
227
+ direction: headerActions ? "row" : "column",
228
+ size: "md",
229
+ children: [
230
+ /* @__PURE__ */ jsx("div", { className: "space-y-1", children: /* @__PURE__ */ jsx(CardTitle, { size: "md", children: title }) }),
231
+ headerActions && /* @__PURE__ */ jsx("div", { className: "flex items-center gap-2", children: headerActions })
232
+ ]
233
+ }
234
+ ),
235
+ /* @__PURE__ */ jsx(CardContent, { size: "md", fullHeight: true, children })
236
+ ]
237
+ }
238
+ )
239
+ );
240
+ FormCard.displayName = "FormCard";
33
241
  var buttonVariants = cva(
34
242
  "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
35
243
  {
@@ -69,171 +277,92 @@ var Button = React13.forwardRef(
69
277
  }
70
278
  );
71
279
  Button.displayName = "Button";
72
- var TOAST_LIMIT = 1;
73
- var TOAST_REMOVE_DELAY = 1e6;
74
- var count = 0;
75
- function genId() {
76
- count = (count + 1) % Number.MAX_SAFE_INTEGER;
77
- return count.toString();
78
- }
79
- var toastTimeouts = /* @__PURE__ */ new Map();
80
- var addToRemoveQueue = (toastId) => {
81
- if (toastTimeouts.has(toastId)) {
82
- return;
83
- }
84
- const timeout = setTimeout(() => {
85
- toastTimeouts.delete(toastId);
86
- dispatch({
87
- type: "REMOVE_TOAST",
88
- toastId
89
- });
90
- }, TOAST_REMOVE_DELAY);
91
- toastTimeouts.set(toastId, timeout);
92
- };
93
- var reducer = (state, action) => {
94
- switch (action.type) {
95
- case "ADD_TOAST":
96
- return {
97
- ...state,
98
- toasts: [action.toast, ...state.toasts].slice(0, TOAST_LIMIT)
99
- };
100
- case "UPDATE_TOAST":
101
- return {
102
- ...state,
103
- toasts: state.toasts.map(
104
- (t) => t.id === action.toast.id ? { ...t, ...action.toast } : t
105
- )
106
- };
107
- case "DISMISS_TOAST": {
108
- const { toastId } = action;
109
- if (toastId) {
110
- addToRemoveQueue(toastId);
111
- } else {
112
- state.toasts.forEach((toast4) => {
113
- addToRemoveQueue(toast4.id);
114
- });
115
- }
116
- return {
117
- ...state,
118
- toasts: state.toasts.map(
119
- (t) => t.id === toastId || toastId === void 0 ? {
120
- ...t,
121
- open: false
122
- } : t
123
- )
124
- };
125
- }
126
- case "REMOVE_TOAST":
127
- if (action.toastId === void 0) {
128
- return {
129
- ...state,
130
- toasts: []
131
- };
132
- }
133
- return {
134
- ...state,
135
- toasts: state.toasts.filter((t) => t.id !== action.toastId)
136
- };
137
- }
138
- };
139
- var listeners = [];
140
- var memoryState = { toasts: [] };
141
- function dispatch(action) {
142
- memoryState = reducer(memoryState, action);
143
- listeners.forEach((listener) => {
144
- listener(memoryState);
145
- });
146
- }
147
- function toast({ ...props }) {
148
- const id = genId();
149
- const update = (props2) => dispatch({
150
- type: "UPDATE_TOAST",
151
- toast: { ...props2, id }
152
- });
153
- const dismiss = () => dispatch({ type: "DISMISS_TOAST", toastId: id });
154
- dispatch({
155
- type: "ADD_TOAST",
156
- toast: {
157
- ...props,
158
- id,
159
- open: true,
160
- onOpenChange: (open) => {
161
- if (!open) dismiss();
162
- }
163
- }
164
- });
165
- return {
166
- id,
167
- dismiss,
168
- update
169
- };
170
- }
171
- function useToast() {
172
- const [state, setState] = React13.useState(memoryState);
173
- React13.useEffect(() => {
174
- listeners.push(setState);
175
- return () => {
176
- const index = listeners.indexOf(setState);
177
- if (index > -1) {
178
- listeners.splice(index, 1);
179
- }
180
- };
181
- }, [state]);
182
- return {
183
- ...state,
184
- toast,
185
- dismiss: (toastId) => dispatch({ type: "DISMISS_TOAST", toastId })
186
- };
187
- }
188
- var inputVariants = cva(
189
- "flex w-full rounded-md bg-form-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground transition-form",
280
+ var badgeVariants = cva(
281
+ "inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
190
282
  {
191
283
  variants: {
192
284
  variant: {
193
- default: "border border-form-border focus-visible:border-form-border-focus focus-visible:outline-none focus-visible:shadow-form-focus",
194
- error: "border border-form-border-error focus-visible:border-form-border-error focus-visible:outline-none focus-visible:shadow-form-error",
195
- success: "border border-form-border-success focus-visible:border-form-border-success focus-visible:outline-none",
196
- disabled: "border border-form-border bg-muted cursor-not-allowed opacity-50",
197
- readonly: "border border-form-border bg-muted/50 cursor-default"
198
- },
199
- size: {
200
- default: "h-10",
201
- sm: "h-9",
202
- lg: "h-11"
285
+ default: "border-transparent bg-primary text-primary-foreground hover:bg-primary/80",
286
+ secondary: "border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",
287
+ destructive: "border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",
288
+ outline: "text-foreground",
289
+ success: "border-transparent bg-success text-success-foreground hover:bg-success/80",
290
+ warning: "border-transparent bg-warning text-warning-foreground hover:bg-warning/80",
291
+ // Business type specific variants
292
+ business: "border-blue-200 bg-blue-50 text-blue-700 hover:bg-blue-100 dark:border-blue-800 dark:bg-blue-950 dark:text-blue-300",
293
+ individual: "border-green-200 bg-green-50 text-green-700 hover:bg-green-100 dark:border-green-800 dark:bg-green-950 dark:text-green-300",
294
+ government: "border-purple-200 bg-purple-50 text-purple-700 hover:bg-purple-100 dark:border-purple-800 dark:bg-purple-950 dark:text-purple-300",
295
+ nonprofit: "border-orange-200 bg-orange-50 text-orange-700 hover:bg-orange-100 dark:border-orange-800 dark:bg-orange-950 dark:text-orange-300",
296
+ // Business entity type variants
297
+ corporation: "border-slate-200 bg-slate-50 text-slate-700 hover:bg-slate-100 dark:border-slate-700 dark:bg-slate-900 dark:text-slate-300",
298
+ llc: "border-teal-200 bg-teal-50 text-teal-700 hover:bg-teal-100 dark:border-teal-800 dark:bg-teal-950 dark:text-teal-300",
299
+ partnership: "border-indigo-200 bg-indigo-50 text-indigo-700 hover:bg-indigo-100 dark:border-indigo-800 dark:bg-indigo-950 dark:text-indigo-300",
300
+ sole_proprietorship: "border-amber-200 bg-amber-50 text-amber-700 hover:bg-amber-100 dark:border-amber-800 dark:bg-amber-950 dark:text-amber-300",
301
+ // Status variants
302
+ active: "border-green-200 bg-green-50 text-green-700 hover:bg-green-100 dark:border-green-800 dark:bg-green-950 dark:text-green-300",
303
+ inactive: "border-red-200 bg-red-50 text-red-700 hover:bg-red-100 dark:border-red-800 dark:bg-red-950 dark:text-red-300",
304
+ pending: "border-yellow-200 bg-yellow-50 text-yellow-700 hover:bg-yellow-100 dark:border-yellow-800 dark:bg-yellow-950 dark:text-yellow-300",
305
+ suspended: "border-gray-200 bg-gray-50 text-gray-700 hover:bg-gray-100 dark:border-gray-700 dark:bg-gray-900 dark:text-gray-300",
306
+ // Alert type subtle variants
307
+ "alert-ofac": "border-red-200 bg-red-50 text-red-700 hover:bg-red-100 dark:border-red-800 dark:bg-red-950 dark:text-red-300 font-medium",
308
+ "alert-dual": "border-emerald-200 bg-emerald-50 text-emerald-700 hover:bg-emerald-100 dark:border-emerald-800 dark:bg-emerald-950 dark:text-emerald-300 font-medium",
309
+ "alert-monitoring": "border-amber-200 bg-amber-50 text-amber-700 hover:bg-amber-100 dark:border-amber-800 dark:bg-amber-950 dark:text-amber-300 font-medium",
310
+ "alert-error": "border-rose-200 bg-rose-50 text-rose-700 hover:bg-rose-100 dark:border-rose-800 dark:bg-rose-950 dark:text-rose-300 font-medium"
203
311
  }
204
312
  },
205
313
  defaultVariants: {
206
- variant: "default",
207
- size: "default"
314
+ variant: "default"
208
315
  }
209
316
  }
210
317
  );
211
- var EnhancedInput = React13.forwardRef(
212
- ({ className, variant, size, label, hint, error, success, isLoading, ...props }, ref) => {
213
- const inputVariant = error ? "error" : success ? "success" : props.disabled ? "disabled" : props.readOnly ? "readonly" : variant;
214
- return /* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
215
- label && /* @__PURE__ */ jsxs("label", { className: "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70", children: [
216
- label,
217
- props.required && /* @__PURE__ */ jsx("span", { className: "text-destructive ml-1", children: "*" })
318
+ function Badge({ className, variant, ...props }) {
319
+ return /* @__PURE__ */ jsx("div", { className: cn(badgeVariants({ variant }), className), ...props });
320
+ }
321
+ var AlertTimeline = ({ events }) => {
322
+ const getIcon = (action) => {
323
+ if (action.includes("Created")) return /* @__PURE__ */ jsx(Circle, { className: "h-4 w-4" });
324
+ if (action.includes("Assigned")) return /* @__PURE__ */ jsx(UserPlus, { className: "h-4 w-4" });
325
+ if (action.includes("Updated") || action.includes("Modified")) return /* @__PURE__ */ jsx(Edit, { className: "h-4 w-4" });
326
+ if (action.includes("Closed") || action.includes("Resolved")) return /* @__PURE__ */ jsx(CheckCircle, { className: "h-4 w-4" });
327
+ if (action.includes("Rejected")) return /* @__PURE__ */ jsx(XCircle, { className: "h-4 w-4" });
328
+ return /* @__PURE__ */ jsx(Circle, { className: "h-4 w-4" });
329
+ };
330
+ const getStatusColor2 = (status) => {
331
+ switch (status) {
332
+ case "Unassigned":
333
+ return "text-destructive";
334
+ case "Closed":
335
+ return "text-success";
336
+ case "In Progress":
337
+ return "text-warning";
338
+ default:
339
+ return "text-muted-foreground";
340
+ }
341
+ };
342
+ if (events.length === 0) {
343
+ return /* @__PURE__ */ jsx("div", { className: "text-center py-8 text-muted-foreground", children: "No timeline events yet" });
344
+ }
345
+ return /* @__PURE__ */ jsx("div", { className: "space-y-3", children: events.map((event, index) => /* @__PURE__ */ jsxs("div", { className: "relative pl-6 pb-3", children: [
346
+ index !== events.length - 1 && /* @__PURE__ */ jsx("div", { className: "absolute left-[7px] top-5 bottom-0 w-[2px] bg-border" }),
347
+ /* @__PURE__ */ jsx("div", { className: cn(
348
+ "absolute left-0 top-0 flex-none",
349
+ getStatusColor2(event.status)
350
+ ), children: /* @__PURE__ */ jsx("div", { className: "h-4 w-4", children: getIcon(event.action) }) }),
351
+ /* @__PURE__ */ jsxs("div", { className: "space-y-0.5", children: [
352
+ /* @__PURE__ */ jsx("p", { className: "text-xs font-medium text-foreground", children: event.action }),
353
+ /* @__PURE__ */ jsxs("p", { className: "text-xs text-muted-foreground", children: [
354
+ "by ",
355
+ event.user
218
356
  ] }),
219
- /* @__PURE__ */ jsxs("div", { className: "relative", children: [
220
- /* @__PURE__ */ jsx(
221
- "input",
222
- {
223
- className: cn(inputVariants({ variant: inputVariant, size, className })),
224
- ref,
225
- ...props
226
- }
227
- ),
228
- isLoading && /* @__PURE__ */ jsx("div", { className: "absolute right-3 top-1/2 transform -translate-y-1/2", children: /* @__PURE__ */ jsx("div", { className: "animate-spin rounded-full h-4 w-4 border-2 border-primary border-t-transparent" }) })
357
+ event.details && /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: event.details }),
358
+ event.status && /* @__PURE__ */ jsxs("p", { className: cn("text-xs font-medium", getStatusColor2(event.status)), children: [
359
+ "Status: ",
360
+ event.status
229
361
  ] }),
230
- hint && !error && !success && /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: hint }),
231
- error && /* @__PURE__ */ jsx("p", { className: "text-xs text-destructive", children: error }),
232
- success && /* @__PURE__ */ jsx("p", { className: "text-xs text-success", children: success })
233
- ] });
234
- }
235
- );
236
- EnhancedInput.displayName = "EnhancedInput";
362
+ /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground/70 pt-0.5", children: event.timestamp })
363
+ ] })
364
+ ] }, event.id)) });
365
+ };
237
366
  var textareaVariants = cva(
238
367
  "flex min-h-[80px] w-full rounded-md bg-form-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground transition-form resize-y",
239
368
  {
@@ -330,179 +459,208 @@ var EnhancedSelect = React13.forwardRef(({ variant, label, hint, error, success,
330
459
  ] });
331
460
  });
332
461
  EnhancedSelect.displayName = "EnhancedSelect";
333
- var AlertDocuments = ({ alertId, documents }) => {
334
- const [isUploading, setIsUploading] = useState(false);
335
- const [showUploadDialog, setShowUploadDialog] = useState(false);
336
- const [selectedFile, setSelectedFile] = useState(null);
337
- const [documentName, setDocumentName] = useState("");
338
- const [description, setDescription] = useState("");
339
- const [documentType, setDocumentType] = useState("");
340
- const handleFileSelect = (e) => {
341
- const file = e.target.files?.[0];
342
- if (!file) return;
343
- setSelectedFile(file);
344
- setDocumentName(file.name);
345
- };
346
- const handleUploadSubmit = () => {
347
- if (!selectedFile || !documentName || !documentType) {
348
- toast({
349
- title: "Missing Information",
350
- description: "Please fill in all required fields",
351
- variant: "destructive"
352
- });
353
- return;
462
+ var TOAST_LIMIT = 1;
463
+ var TOAST_REMOVE_DELAY = 1e6;
464
+ var count = 0;
465
+ function genId() {
466
+ count = (count + 1) % Number.MAX_SAFE_INTEGER;
467
+ return count.toString();
468
+ }
469
+ var toastTimeouts = /* @__PURE__ */ new Map();
470
+ var addToRemoveQueue = (toastId) => {
471
+ if (toastTimeouts.has(toastId)) {
472
+ return;
473
+ }
474
+ const timeout = setTimeout(() => {
475
+ toastTimeouts.delete(toastId);
476
+ dispatch({
477
+ type: "REMOVE_TOAST",
478
+ toastId
479
+ });
480
+ }, TOAST_REMOVE_DELAY);
481
+ toastTimeouts.set(toastId, timeout);
482
+ };
483
+ var reducer = (state, action) => {
484
+ switch (action.type) {
485
+ case "ADD_TOAST":
486
+ return {
487
+ ...state,
488
+ toasts: [action.toast, ...state.toasts].slice(0, TOAST_LIMIT)
489
+ };
490
+ case "UPDATE_TOAST":
491
+ return {
492
+ ...state,
493
+ toasts: state.toasts.map(
494
+ (t) => t.id === action.toast.id ? { ...t, ...action.toast } : t
495
+ )
496
+ };
497
+ case "DISMISS_TOAST": {
498
+ const { toastId } = action;
499
+ if (toastId) {
500
+ addToRemoveQueue(toastId);
501
+ } else {
502
+ state.toasts.forEach((toast4) => {
503
+ addToRemoveQueue(toast4.id);
504
+ });
505
+ }
506
+ return {
507
+ ...state,
508
+ toasts: state.toasts.map(
509
+ (t) => t.id === toastId || toastId === void 0 ? {
510
+ ...t,
511
+ open: false
512
+ } : t
513
+ )
514
+ };
354
515
  }
355
- setIsUploading(true);
356
- setTimeout(() => {
357
- ({
358
- size: `${(selectedFile.size / 1024 / 1024).toFixed(1)} MB`,
359
- uploadedAt: (/* @__PURE__ */ new Date()).toISOString()
360
- });
361
- toast({
362
- title: "Upload Successful",
363
- description: `${documentName} uploaded successfully`
364
- });
365
- setIsUploading(false);
366
- setShowUploadDialog(false);
367
- resetForm();
368
- }, 1e3);
516
+ case "REMOVE_TOAST":
517
+ if (action.toastId === void 0) {
518
+ return {
519
+ ...state,
520
+ toasts: []
521
+ };
522
+ }
523
+ return {
524
+ ...state,
525
+ toasts: state.toasts.filter((t) => t.id !== action.toastId)
526
+ };
527
+ }
528
+ };
529
+ var listeners = [];
530
+ var memoryState = { toasts: [] };
531
+ function dispatch(action) {
532
+ memoryState = reducer(memoryState, action);
533
+ listeners.forEach((listener) => {
534
+ listener(memoryState);
535
+ });
536
+ }
537
+ function toast({ ...props }) {
538
+ const id = genId();
539
+ const update = (props2) => dispatch({
540
+ type: "UPDATE_TOAST",
541
+ toast: { ...props2, id }
542
+ });
543
+ const dismiss = () => dispatch({ type: "DISMISS_TOAST", toastId: id });
544
+ dispatch({
545
+ type: "ADD_TOAST",
546
+ toast: {
547
+ ...props,
548
+ id,
549
+ open: true,
550
+ onOpenChange: (open) => {
551
+ if (!open) dismiss();
552
+ }
553
+ }
554
+ });
555
+ return {
556
+ id,
557
+ dismiss,
558
+ update
559
+ };
560
+ }
561
+ function useToast() {
562
+ const [state, setState] = React13.useState(memoryState);
563
+ React13.useEffect(() => {
564
+ listeners.push(setState);
565
+ return () => {
566
+ const index = listeners.indexOf(setState);
567
+ if (index > -1) {
568
+ listeners.splice(index, 1);
569
+ }
570
+ };
571
+ }, [state]);
572
+ return {
573
+ ...state,
574
+ toast,
575
+ dismiss: (toastId) => dispatch({ type: "DISMISS_TOAST", toastId })
369
576
  };
577
+ }
578
+ var NOTE_TYPE_OPTIONS = [
579
+ { value: "RFI Note", label: "RFI Note" },
580
+ { value: "Internal Note", label: "Internal Note" }
581
+ ];
582
+ var AlertNotes = ({ alertId, notes }) => {
583
+ const [showNoteDialog, setShowNoteDialog] = useState(false);
584
+ const [newNote, setNewNote] = useState("");
585
+ const [noteType, setNoteType] = useState("RFI Note");
586
+ const [isSubmitting, setIsSubmitting] = useState(false);
370
587
  const resetForm = () => {
371
- setSelectedFile(null);
372
- setDocumentName("");
373
- setDescription("");
374
- setDocumentType("");
375
- const fileInput = document.getElementById("file-upload");
376
- if (fileInput) fileInput.value = "";
588
+ setNewNote("");
589
+ setNoteType("RFI Note");
377
590
  };
378
- const handleCancelUpload = () => {
379
- setShowUploadDialog(false);
591
+ const handleCancelNote = () => {
592
+ setShowNoteDialog(false);
380
593
  resetForm();
381
594
  };
382
- const isImageType = (name) => {
383
- const imageExtensions = [".jpg", ".jpeg", ".png", ".gif", ".webp", ".bmp"];
384
- return imageExtensions.some((ext) => name.toLowerCase().endsWith(ext));
385
- };
386
- const getFileIcon = (type) => {
387
- return /* @__PURE__ */ jsx(FileText, { className: "h-5 w-5" });
388
- };
389
- const getFileTypeColor = (type) => {
390
- switch (type.toUpperCase()) {
391
- case "PDF":
392
- return "text-red-500";
393
- case "DOCX":
394
- case "DOC":
395
- return "text-blue-500";
396
- case "XLSX":
397
- case "XLS":
398
- return "text-green-500";
399
- case "JPG":
400
- case "JPEG":
401
- case "PNG":
402
- return "text-purple-500";
403
- default:
404
- return "text-muted-foreground";
595
+ const handleAddNote = async () => {
596
+ if (!newNote.trim()) {
597
+ toast({
598
+ title: "Error",
599
+ description: "Please enter a note before submitting",
600
+ variant: "destructive"
601
+ });
602
+ return;
405
603
  }
604
+ setIsSubmitting(true);
605
+ setTimeout(() => {
606
+ toast({
607
+ title: "Note Added",
608
+ description: "Your note has been added successfully"
609
+ });
610
+ setShowNoteDialog(false);
611
+ resetForm();
612
+ setIsSubmitting(false);
613
+ }, 500);
614
+ };
615
+ const handleDeleteNote = (noteId, noteContent) => {
616
+ toast({
617
+ title: "Note Deleted",
618
+ description: `Note deleted successfully`
619
+ });
620
+ console.log("Deleting note:", noteId);
406
621
  };
407
- const documentTypeOptions = [
408
- { value: "ID_DOCUMENT_FRONT", label: "ID Document (Front)" },
409
- { value: "ID_DOCUMENT_BACK", label: "ID Document (Back)" },
410
- { value: "PASSPORT", label: "Passport" },
411
- { value: "PROOF_OF_ADDRESS", label: "Proof of Address" },
412
- { value: "BANK_STATEMENT", label: "Bank Statement" },
413
- { value: "BUSINESS_LICENSE", label: "Business License" },
414
- { value: "TAX_DOCUMENT", label: "Tax Document" },
415
- { value: "OTHER", label: "Other" }
416
- ];
417
622
  return /* @__PURE__ */ jsxs("div", { className: "space-y-6", children: [
418
- showUploadDialog && createPortal(
623
+ showNoteDialog && createPortal(
419
624
  /* @__PURE__ */ jsxs("div", { className: "fixed inset-0 z-[100] flex items-center justify-center p-4", children: [
420
625
  /* @__PURE__ */ jsx(
421
626
  "div",
422
627
  {
423
628
  className: "fixed inset-0 bg-background/80 backdrop-blur-sm",
424
- onClick: handleCancelUpload
629
+ onClick: handleCancelNote
425
630
  }
426
631
  ),
427
632
  /* @__PURE__ */ jsxs("div", { className: "relative bg-card border rounded-lg shadow-lg max-w-lg w-full p-6 z-[101]", children: [
428
633
  /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between mb-6", children: [
429
- /* @__PURE__ */ jsx("h2", { className: "text-2xl font-bold", children: "Upload Document" }),
634
+ /* @__PURE__ */ jsx("h2", { className: "text-2xl font-bold", children: "Add Note" }),
430
635
  /* @__PURE__ */ jsx(
431
636
  Button,
432
637
  {
433
638
  variant: "ghost",
434
639
  size: "sm",
435
640
  className: "h-8 w-8 p-0",
436
- onClick: handleCancelUpload,
641
+ onClick: handleCancelNote,
437
642
  children: /* @__PURE__ */ jsx(X, { className: "h-4 w-4" })
438
643
  }
439
644
  )
440
645
  ] }),
441
646
  /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
442
- /* @__PURE__ */ jsxs("div", { className: "border-2 border-dashed rounded-lg p-6 text-center hover:border-primary/50 transition-colors", children: [
443
- /* @__PURE__ */ jsx(
444
- "input",
445
- {
446
- type: "file",
447
- id: "file-upload-dialog",
448
- className: "hidden",
449
- onChange: handleFileSelect,
450
- disabled: isUploading
451
- }
452
- ),
453
- /* @__PURE__ */ jsxs(
454
- "label",
455
- {
456
- htmlFor: "file-upload-dialog",
457
- className: cn(
458
- "cursor-pointer flex flex-col items-center gap-2",
459
- isUploading && "opacity-50 cursor-not-allowed"
460
- ),
461
- children: [
462
- /* @__PURE__ */ jsx(Upload, { className: "h-8 w-8 text-muted-foreground" }),
463
- /* @__PURE__ */ jsxs("div", { children: [
464
- /* @__PURE__ */ jsx("p", { className: "text-sm font-medium text-foreground", children: selectedFile ? "Change file" : "Click to upload or drag and drop" }),
465
- /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground mt-1", children: "PDF, DOC, DOCX, JPG, PNG up to 10MB" })
466
- ] })
467
- ]
468
- }
469
- )
470
- ] }),
471
- selectedFile && /* @__PURE__ */ jsxs("div", { className: "p-3 bg-muted/50 rounded-lg", children: [
472
- /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: "Selected file:" }),
473
- /* @__PURE__ */ jsx("p", { className: "text-sm font-medium", children: selectedFile.name }),
474
- /* @__PURE__ */ jsxs("p", { className: "text-xs text-muted-foreground", children: [
475
- (selectedFile.size / 1024 / 1024).toFixed(2),
476
- " MB"
477
- ] })
478
- ] }),
479
647
  /* @__PURE__ */ jsx(
480
- EnhancedInput,
648
+ EnhancedSelect,
481
649
  {
482
- label: "Document name",
483
- value: documentName,
484
- onChange: (e) => setDocumentName(e.target.value),
485
- placeholder: "Enter document name"
650
+ label: "Note Type",
651
+ value: noteType,
652
+ onValueChange: (value) => setNoteType(value),
653
+ options: NOTE_TYPE_OPTIONS
486
654
  }
487
655
  ),
488
656
  /* @__PURE__ */ jsx(
489
657
  EnhancedTextarea,
490
658
  {
491
- label: "Description",
492
- value: description,
493
- onChange: (e) => setDescription(e.target.value),
494
- placeholder: "Enter document description (optional)",
495
- rows: 3
496
- }
497
- ),
498
- /* @__PURE__ */ jsx(
499
- EnhancedSelect,
500
- {
501
- label: "Document type",
502
- value: documentType,
503
- onValueChange: setDocumentType,
504
- placeholder: "Select document type",
505
- options: documentTypeOptions
659
+ label: "Note",
660
+ placeholder: "Enter your note here...",
661
+ value: newNote,
662
+ onChange: (e) => setNewNote(e.target.value),
663
+ rows: 6
506
664
  }
507
665
  )
508
666
  ] }),
@@ -511,8 +669,8 @@ var AlertDocuments = ({ alertId, documents }) => {
511
669
  Button,
512
670
  {
513
671
  variant: "outline",
514
- onClick: handleCancelUpload,
515
- disabled: isUploading,
672
+ onClick: handleCancelNote,
673
+ disabled: isSubmitting,
516
674
  className: "flex-1",
517
675
  children: "Cancel"
518
676
  }
@@ -520,10 +678,10 @@ var AlertDocuments = ({ alertId, documents }) => {
520
678
  /* @__PURE__ */ jsx(
521
679
  Button,
522
680
  {
523
- onClick: handleUploadSubmit,
524
- disabled: isUploading,
681
+ onClick: handleAddNote,
682
+ disabled: isSubmitting || !newNote.trim(),
525
683
  className: "flex-1",
526
- children: isUploading ? "Uploading..." : "Upload"
684
+ children: isSubmitting ? "Adding..." : "Add Note"
527
685
  }
528
686
  )
529
687
  ] })
@@ -531,224 +689,280 @@ var AlertDocuments = ({ alertId, documents }) => {
531
689
  ] }),
532
690
  document.body
533
691
  ),
534
- /* @__PURE__ */ jsxs("div", { className: "space-y-3", children: [
692
+ /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
535
693
  /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
536
- /* @__PURE__ */ jsx("h3", { className: "text-sm font-medium text-foreground", children: "Uploaded Documents" }),
694
+ /* @__PURE__ */ jsx("h3", { className: "text-sm font-medium text-foreground", children: "Note History" }),
537
695
  /* @__PURE__ */ jsxs(
538
696
  Button,
539
697
  {
540
- onClick: () => setShowUploadDialog(true),
698
+ onClick: () => setShowNoteDialog(true),
541
699
  variant: "ghost",
542
700
  size: "sm",
543
701
  className: "gap-2 text-primary hover:text-primary",
544
702
  children: [
545
- /* @__PURE__ */ jsx(Upload, { className: "h-4 w-4" }),
546
- "Upload"
703
+ /* @__PURE__ */ jsx(Plus, { className: "h-4 w-4" }),
704
+ "Add Note"
547
705
  ]
548
706
  }
549
707
  )
550
708
  ] }),
551
- documents.length === 0 ? /* @__PURE__ */ jsxs("div", { className: "text-center py-8 text-muted-foreground", children: [
552
- /* @__PURE__ */ jsx(FileText, { className: "h-8 w-8 mx-auto mb-2 opacity-50" }),
553
- /* @__PURE__ */ jsx("p", { children: "No documents uploaded yet" })
554
- ] }) : /* @__PURE__ */ jsx("div", { className: "space-y-2", children: documents.map((doc) => /* @__PURE__ */ jsxs(
555
- "div",
556
- {
557
- className: "border rounded-lg hover:bg-muted/30 transition-colors overflow-hidden",
709
+ notes.length === 0 ? /* @__PURE__ */ jsxs("div", { className: "text-center py-8 text-muted-foreground", children: [
710
+ /* @__PURE__ */ jsx(MessageSquare, { className: "h-8 w-8 mx-auto mb-2 opacity-50" }),
711
+ /* @__PURE__ */ jsx("p", { children: "No notes yet" })
712
+ ] }) : /* @__PURE__ */ jsx("div", { className: "space-y-3", children: notes.map((note) => /* @__PURE__ */ jsxs(
713
+ "div",
714
+ {
715
+ className: "border rounded-lg p-4 bg-muted/30",
558
716
  children: [
559
- isImageType(doc.name) && doc.url && /* @__PURE__ */ jsx("div", { className: "w-full bg-muted/50", children: /* @__PURE__ */ jsx(
560
- "img",
561
- {
562
- src: doc.url,
563
- alt: doc.name,
564
- className: "w-full h-48 object-cover"
565
- }
566
- ) }),
567
- /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between p-3", children: [
568
- /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3 flex-1 min-w-0", children: [
569
- !isImageType(doc.name) && /* @__PURE__ */ jsx("div", { className: cn(getFileTypeColor(doc.type)), children: getFileIcon(doc.type) }),
570
- /* @__PURE__ */ jsxs("div", { className: "flex-1 min-w-0", children: [
571
- /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
572
- /* @__PURE__ */ jsx("h4", { className: "font-medium text-sm truncate", children: doc.name }),
573
- /* @__PURE__ */ jsx("span", { className: cn("text-xs px-2 py-0.5 rounded-full bg-muted", getFileTypeColor(doc.type)), children: doc.type })
574
- ] }),
575
- doc.description && /* @__PURE__ */ jsx("p", { className: "text-sm text-foreground mt-1", children: doc.description }),
576
- /* @__PURE__ */ jsxs("p", { className: "text-xs text-muted-foreground mt-1", children: [
577
- doc.size,
578
- " \u2022 Uploaded by ",
579
- doc.uploadedBy,
580
- " \u2022 ",
581
- new Date(doc.uploadedAt).toLocaleDateString()
582
- ] })
583
- ] })
717
+ /* @__PURE__ */ jsxs("div", { className: "flex items-start justify-between gap-4 mb-2", children: [
718
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
719
+ /* @__PURE__ */ jsx("p", { className: "font-medium text-sm text-foreground", children: note.user }),
720
+ /* @__PURE__ */ jsx(Badge, { variant: note.type === "RFI Note" ? "default" : "outline", children: note.type })
584
721
  ] }),
585
- /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1", children: [
586
- /* @__PURE__ */ jsx(
587
- Button,
588
- {
589
- variant: "ghost",
590
- size: "sm",
591
- className: "h-8 w-8 p-0",
592
- onClick: () => toast({ title: "Preview", description: `Viewing ${doc.name}` }),
593
- children: /* @__PURE__ */ jsx(Eye, { className: "h-4 w-4" })
594
- }
595
- ),
596
- /* @__PURE__ */ jsx(
597
- Button,
598
- {
599
- variant: "ghost",
600
- size: "sm",
601
- className: "h-8 w-8 p-0",
602
- onClick: () => toast({ title: "Download", description: `Downloading ${doc.name}` }),
603
- children: /* @__PURE__ */ jsx(Download, { className: "h-4 w-4" })
604
- }
605
- ),
722
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
723
+ /* @__PURE__ */ jsx("span", { className: "text-xs text-muted-foreground whitespace-nowrap", children: note.timestamp }),
606
724
  /* @__PURE__ */ jsx(
607
725
  Button,
608
726
  {
609
727
  variant: "ghost",
610
728
  size: "sm",
611
729
  className: "h-8 w-8 p-0 text-muted-foreground hover:text-foreground",
612
- onClick: () => toast({ title: "Delete", description: `Deleted ${doc.name}` }),
730
+ onClick: () => handleDeleteNote(note.id, note.content),
613
731
  children: /* @__PURE__ */ jsx(Trash2, { className: "h-4 w-4" })
614
732
  }
615
733
  )
616
734
  ] })
617
- ] })
735
+ ] }),
736
+ /* @__PURE__ */ jsx("p", { className: "text-sm text-foreground", children: note.content })
618
737
  ]
619
738
  },
620
- doc.id
739
+ note.id
621
740
  )) })
622
741
  ] })
623
742
  ] });
624
743
  };
625
- var badgeVariants = cva(
626
- "inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
744
+ var inputVariants = cva(
745
+ "flex w-full rounded-md bg-form-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground transition-form",
627
746
  {
628
747
  variants: {
629
748
  variant: {
630
- default: "border-transparent bg-primary text-primary-foreground hover:bg-primary/80",
631
- secondary: "border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",
632
- destructive: "border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",
633
- outline: "text-foreground",
634
- success: "border-transparent bg-success text-success-foreground hover:bg-success/80",
635
- warning: "border-transparent bg-warning text-warning-foreground hover:bg-warning/80",
636
- // Business type specific variants
637
- business: "border-blue-200 bg-blue-50 text-blue-700 hover:bg-blue-100 dark:border-blue-800 dark:bg-blue-950 dark:text-blue-300",
638
- individual: "border-green-200 bg-green-50 text-green-700 hover:bg-green-100 dark:border-green-800 dark:bg-green-950 dark:text-green-300",
639
- government: "border-purple-200 bg-purple-50 text-purple-700 hover:bg-purple-100 dark:border-purple-800 dark:bg-purple-950 dark:text-purple-300",
640
- nonprofit: "border-orange-200 bg-orange-50 text-orange-700 hover:bg-orange-100 dark:border-orange-800 dark:bg-orange-950 dark:text-orange-300",
641
- // Business entity type variants
642
- corporation: "border-slate-200 bg-slate-50 text-slate-700 hover:bg-slate-100 dark:border-slate-700 dark:bg-slate-900 dark:text-slate-300",
643
- llc: "border-teal-200 bg-teal-50 text-teal-700 hover:bg-teal-100 dark:border-teal-800 dark:bg-teal-950 dark:text-teal-300",
644
- partnership: "border-indigo-200 bg-indigo-50 text-indigo-700 hover:bg-indigo-100 dark:border-indigo-800 dark:bg-indigo-950 dark:text-indigo-300",
645
- sole_proprietorship: "border-amber-200 bg-amber-50 text-amber-700 hover:bg-amber-100 dark:border-amber-800 dark:bg-amber-950 dark:text-amber-300",
646
- // Status variants
647
- active: "border-green-200 bg-green-50 text-green-700 hover:bg-green-100 dark:border-green-800 dark:bg-green-950 dark:text-green-300",
648
- inactive: "border-red-200 bg-red-50 text-red-700 hover:bg-red-100 dark:border-red-800 dark:bg-red-950 dark:text-red-300",
649
- pending: "border-yellow-200 bg-yellow-50 text-yellow-700 hover:bg-yellow-100 dark:border-yellow-800 dark:bg-yellow-950 dark:text-yellow-300",
650
- suspended: "border-gray-200 bg-gray-50 text-gray-700 hover:bg-gray-100 dark:border-gray-700 dark:bg-gray-900 dark:text-gray-300",
651
- // Alert type subtle variants
652
- "alert-ofac": "border-red-200 bg-red-50 text-red-700 hover:bg-red-100 dark:border-red-800 dark:bg-red-950 dark:text-red-300 font-medium",
653
- "alert-dual": "border-emerald-200 bg-emerald-50 text-emerald-700 hover:bg-emerald-100 dark:border-emerald-800 dark:bg-emerald-950 dark:text-emerald-300 font-medium",
654
- "alert-monitoring": "border-amber-200 bg-amber-50 text-amber-700 hover:bg-amber-100 dark:border-amber-800 dark:bg-amber-950 dark:text-amber-300 font-medium",
655
- "alert-error": "border-rose-200 bg-rose-50 text-rose-700 hover:bg-rose-100 dark:border-rose-800 dark:bg-rose-950 dark:text-rose-300 font-medium"
749
+ default: "border border-form-border focus-visible:border-form-border-focus focus-visible:outline-none focus-visible:shadow-form-focus",
750
+ error: "border border-form-border-error focus-visible:border-form-border-error focus-visible:outline-none focus-visible:shadow-form-error",
751
+ success: "border border-form-border-success focus-visible:border-form-border-success focus-visible:outline-none",
752
+ disabled: "border border-form-border bg-muted cursor-not-allowed opacity-50",
753
+ readonly: "border border-form-border bg-muted/50 cursor-default"
754
+ },
755
+ size: {
756
+ default: "h-10",
757
+ sm: "h-9",
758
+ lg: "h-11"
656
759
  }
657
760
  },
658
761
  defaultVariants: {
659
- variant: "default"
762
+ variant: "default",
763
+ size: "default"
660
764
  }
661
765
  }
662
766
  );
663
- function Badge({ className, variant, ...props }) {
664
- return /* @__PURE__ */ jsx("div", { className: cn(badgeVariants({ variant }), className), ...props });
665
- }
666
- var NOTE_TYPE_OPTIONS = [
667
- { value: "RFI Note", label: "RFI Note" },
668
- { value: "Internal Note", label: "Internal Note" }
669
- ];
670
- var AlertNotes = ({ alertId, notes }) => {
671
- const [showNoteDialog, setShowNoteDialog] = useState(false);
672
- const [newNote, setNewNote] = useState("");
673
- const [noteType, setNoteType] = useState("RFI Note");
674
- const [isSubmitting, setIsSubmitting] = useState(false);
675
- const resetForm = () => {
676
- setNewNote("");
677
- setNoteType("RFI Note");
678
- };
679
- const handleCancelNote = () => {
680
- setShowNoteDialog(false);
681
- resetForm();
767
+ var EnhancedInput = React13.forwardRef(
768
+ ({ className, variant, size, label, hint, error, success, isLoading, ...props }, ref) => {
769
+ const inputVariant = error ? "error" : success ? "success" : props.disabled ? "disabled" : props.readOnly ? "readonly" : variant;
770
+ return /* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
771
+ label && /* @__PURE__ */ jsxs("label", { className: "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70", children: [
772
+ label,
773
+ props.required && /* @__PURE__ */ jsx("span", { className: "text-destructive ml-1", children: "*" })
774
+ ] }),
775
+ /* @__PURE__ */ jsxs("div", { className: "relative", children: [
776
+ /* @__PURE__ */ jsx(
777
+ "input",
778
+ {
779
+ className: cn(inputVariants({ variant: inputVariant, size, className })),
780
+ ref,
781
+ ...props
782
+ }
783
+ ),
784
+ isLoading && /* @__PURE__ */ jsx("div", { className: "absolute right-3 top-1/2 transform -translate-y-1/2", children: /* @__PURE__ */ jsx("div", { className: "animate-spin rounded-full h-4 w-4 border-2 border-primary border-t-transparent" }) })
785
+ ] }),
786
+ hint && !error && !success && /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: hint }),
787
+ error && /* @__PURE__ */ jsx("p", { className: "text-xs text-destructive", children: error }),
788
+ success && /* @__PURE__ */ jsx("p", { className: "text-xs text-success", children: success })
789
+ ] });
790
+ }
791
+ );
792
+ EnhancedInput.displayName = "EnhancedInput";
793
+ var AlertDocuments = ({ alertId, documents }) => {
794
+ const [isUploading, setIsUploading] = useState(false);
795
+ const [showUploadDialog, setShowUploadDialog] = useState(false);
796
+ const [selectedFile, setSelectedFile] = useState(null);
797
+ const [documentName, setDocumentName] = useState("");
798
+ const [description, setDescription] = useState("");
799
+ const [documentType, setDocumentType] = useState("");
800
+ const handleFileSelect = (e) => {
801
+ const file = e.target.files?.[0];
802
+ if (!file) return;
803
+ setSelectedFile(file);
804
+ setDocumentName(file.name);
682
805
  };
683
- const handleAddNote = async () => {
684
- if (!newNote.trim()) {
806
+ const handleUploadSubmit = () => {
807
+ if (!selectedFile || !documentName || !documentType) {
685
808
  toast({
686
- title: "Error",
687
- description: "Please enter a note before submitting",
809
+ title: "Missing Information",
810
+ description: "Please fill in all required fields",
688
811
  variant: "destructive"
689
812
  });
690
813
  return;
691
814
  }
692
- setIsSubmitting(true);
815
+ setIsUploading(true);
693
816
  setTimeout(() => {
817
+ ({
818
+ size: `${(selectedFile.size / 1024 / 1024).toFixed(1)} MB`,
819
+ uploadedAt: (/* @__PURE__ */ new Date()).toISOString()
820
+ });
694
821
  toast({
695
- title: "Note Added",
696
- description: "Your note has been added successfully"
822
+ title: "Upload Successful",
823
+ description: `${documentName} uploaded successfully`
697
824
  });
698
- setShowNoteDialog(false);
825
+ setIsUploading(false);
826
+ setShowUploadDialog(false);
699
827
  resetForm();
700
- setIsSubmitting(false);
701
- }, 500);
828
+ }, 1e3);
702
829
  };
703
- const handleDeleteNote = (noteId, noteContent) => {
704
- toast({
705
- title: "Note Deleted",
706
- description: `Note deleted successfully`
707
- });
708
- console.log("Deleting note:", noteId);
830
+ const resetForm = () => {
831
+ setSelectedFile(null);
832
+ setDocumentName("");
833
+ setDescription("");
834
+ setDocumentType("");
835
+ const fileInput = document.getElementById("file-upload");
836
+ if (fileInput) fileInput.value = "";
837
+ };
838
+ const handleCancelUpload = () => {
839
+ setShowUploadDialog(false);
840
+ resetForm();
841
+ };
842
+ const isImageType = (name) => {
843
+ const imageExtensions = [".jpg", ".jpeg", ".png", ".gif", ".webp", ".bmp"];
844
+ return imageExtensions.some((ext) => name.toLowerCase().endsWith(ext));
845
+ };
846
+ const getFileIcon = (type) => {
847
+ return /* @__PURE__ */ jsx(FileText, { className: "h-5 w-5" });
848
+ };
849
+ const getFileTypeColor = (type) => {
850
+ switch (type.toUpperCase()) {
851
+ case "PDF":
852
+ return "text-red-500";
853
+ case "DOCX":
854
+ case "DOC":
855
+ return "text-blue-500";
856
+ case "XLSX":
857
+ case "XLS":
858
+ return "text-green-500";
859
+ case "JPG":
860
+ case "JPEG":
861
+ case "PNG":
862
+ return "text-purple-500";
863
+ default:
864
+ return "text-muted-foreground";
865
+ }
709
866
  };
867
+ const documentTypeOptions = [
868
+ { value: "ID_DOCUMENT_FRONT", label: "ID Document (Front)" },
869
+ { value: "ID_DOCUMENT_BACK", label: "ID Document (Back)" },
870
+ { value: "PASSPORT", label: "Passport" },
871
+ { value: "PROOF_OF_ADDRESS", label: "Proof of Address" },
872
+ { value: "BANK_STATEMENT", label: "Bank Statement" },
873
+ { value: "BUSINESS_LICENSE", label: "Business License" },
874
+ { value: "TAX_DOCUMENT", label: "Tax Document" },
875
+ { value: "OTHER", label: "Other" }
876
+ ];
710
877
  return /* @__PURE__ */ jsxs("div", { className: "space-y-6", children: [
711
- showNoteDialog && createPortal(
878
+ showUploadDialog && createPortal(
712
879
  /* @__PURE__ */ jsxs("div", { className: "fixed inset-0 z-[100] flex items-center justify-center p-4", children: [
713
880
  /* @__PURE__ */ jsx(
714
881
  "div",
715
882
  {
716
883
  className: "fixed inset-0 bg-background/80 backdrop-blur-sm",
717
- onClick: handleCancelNote
884
+ onClick: handleCancelUpload
718
885
  }
719
886
  ),
720
887
  /* @__PURE__ */ jsxs("div", { className: "relative bg-card border rounded-lg shadow-lg max-w-lg w-full p-6 z-[101]", children: [
721
888
  /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between mb-6", children: [
722
- /* @__PURE__ */ jsx("h2", { className: "text-2xl font-bold", children: "Add Note" }),
889
+ /* @__PURE__ */ jsx("h2", { className: "text-2xl font-bold", children: "Upload Document" }),
723
890
  /* @__PURE__ */ jsx(
724
891
  Button,
725
892
  {
726
893
  variant: "ghost",
727
894
  size: "sm",
728
895
  className: "h-8 w-8 p-0",
729
- onClick: handleCancelNote,
896
+ onClick: handleCancelUpload,
730
897
  children: /* @__PURE__ */ jsx(X, { className: "h-4 w-4" })
731
898
  }
732
899
  )
733
900
  ] }),
734
901
  /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
735
- /* @__PURE__ */ jsx(
736
- EnhancedSelect,
737
- {
738
- label: "Note Type",
739
- value: noteType,
740
- onValueChange: (value) => setNoteType(value),
741
- options: NOTE_TYPE_OPTIONS
902
+ /* @__PURE__ */ jsxs("div", { className: "border-2 border-dashed rounded-lg p-6 text-center hover:border-primary/50 transition-colors", children: [
903
+ /* @__PURE__ */ jsx(
904
+ "input",
905
+ {
906
+ type: "file",
907
+ id: "file-upload-dialog",
908
+ className: "hidden",
909
+ onChange: handleFileSelect,
910
+ disabled: isUploading
911
+ }
912
+ ),
913
+ /* @__PURE__ */ jsxs(
914
+ "label",
915
+ {
916
+ htmlFor: "file-upload-dialog",
917
+ className: cn(
918
+ "cursor-pointer flex flex-col items-center gap-2",
919
+ isUploading && "opacity-50 cursor-not-allowed"
920
+ ),
921
+ children: [
922
+ /* @__PURE__ */ jsx(Upload, { className: "h-8 w-8 text-muted-foreground" }),
923
+ /* @__PURE__ */ jsxs("div", { children: [
924
+ /* @__PURE__ */ jsx("p", { className: "text-sm font-medium text-foreground", children: selectedFile ? "Change file" : "Click to upload or drag and drop" }),
925
+ /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground mt-1", children: "PDF, DOC, DOCX, JPG, PNG up to 10MB" })
926
+ ] })
927
+ ]
928
+ }
929
+ )
930
+ ] }),
931
+ selectedFile && /* @__PURE__ */ jsxs("div", { className: "p-3 bg-muted/50 rounded-lg", children: [
932
+ /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: "Selected file:" }),
933
+ /* @__PURE__ */ jsx("p", { className: "text-sm font-medium", children: selectedFile.name }),
934
+ /* @__PURE__ */ jsxs("p", { className: "text-xs text-muted-foreground", children: [
935
+ (selectedFile.size / 1024 / 1024).toFixed(2),
936
+ " MB"
937
+ ] })
938
+ ] }),
939
+ /* @__PURE__ */ jsx(
940
+ EnhancedInput,
941
+ {
942
+ label: "Document name",
943
+ value: documentName,
944
+ onChange: (e) => setDocumentName(e.target.value),
945
+ placeholder: "Enter document name"
742
946
  }
743
947
  ),
744
948
  /* @__PURE__ */ jsx(
745
949
  EnhancedTextarea,
746
950
  {
747
- label: "Note",
748
- placeholder: "Enter your note here...",
749
- value: newNote,
750
- onChange: (e) => setNewNote(e.target.value),
751
- rows: 6
951
+ label: "Description",
952
+ value: description,
953
+ onChange: (e) => setDescription(e.target.value),
954
+ placeholder: "Enter document description (optional)",
955
+ rows: 3
956
+ }
957
+ ),
958
+ /* @__PURE__ */ jsx(
959
+ EnhancedSelect,
960
+ {
961
+ label: "Document type",
962
+ value: documentType,
963
+ onValueChange: setDocumentType,
964
+ placeholder: "Select document type",
965
+ options: documentTypeOptions
752
966
  }
753
967
  )
754
968
  ] }),
@@ -757,8 +971,8 @@ var AlertNotes = ({ alertId, notes }) => {
757
971
  Button,
758
972
  {
759
973
  variant: "outline",
760
- onClick: handleCancelNote,
761
- disabled: isSubmitting,
974
+ onClick: handleCancelUpload,
975
+ disabled: isUploading,
762
976
  className: "flex-1",
763
977
  children: "Cancel"
764
978
  }
@@ -766,10 +980,10 @@ var AlertNotes = ({ alertId, notes }) => {
766
980
  /* @__PURE__ */ jsx(
767
981
  Button,
768
982
  {
769
- onClick: handleAddNote,
770
- disabled: isSubmitting || !newNote.trim(),
983
+ onClick: handleUploadSubmit,
984
+ disabled: isUploading,
771
985
  className: "flex-1",
772
- children: isSubmitting ? "Adding..." : "Add Note"
986
+ children: isUploading ? "Uploading..." : "Upload"
773
987
  }
774
988
  )
775
989
  ] })
@@ -777,311 +991,97 @@ var AlertNotes = ({ alertId, notes }) => {
777
991
  ] }),
778
992
  document.body
779
993
  ),
780
- /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
994
+ /* @__PURE__ */ jsxs("div", { className: "space-y-3", children: [
781
995
  /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
782
- /* @__PURE__ */ jsx("h3", { className: "text-sm font-medium text-foreground", children: "Note History" }),
996
+ /* @__PURE__ */ jsx("h3", { className: "text-sm font-medium text-foreground", children: "Uploaded Documents" }),
783
997
  /* @__PURE__ */ jsxs(
784
998
  Button,
785
999
  {
786
- onClick: () => setShowNoteDialog(true),
1000
+ onClick: () => setShowUploadDialog(true),
787
1001
  variant: "ghost",
788
1002
  size: "sm",
789
1003
  className: "gap-2 text-primary hover:text-primary",
790
1004
  children: [
791
- /* @__PURE__ */ jsx(Plus, { className: "h-4 w-4" }),
792
- "Add Note"
1005
+ /* @__PURE__ */ jsx(Upload, { className: "h-4 w-4" }),
1006
+ "Upload"
793
1007
  ]
794
1008
  }
795
1009
  )
796
1010
  ] }),
797
- notes.length === 0 ? /* @__PURE__ */ jsxs("div", { className: "text-center py-8 text-muted-foreground", children: [
798
- /* @__PURE__ */ jsx(MessageSquare, { className: "h-8 w-8 mx-auto mb-2 opacity-50" }),
799
- /* @__PURE__ */ jsx("p", { children: "No notes yet" })
800
- ] }) : /* @__PURE__ */ jsx("div", { className: "space-y-3", children: notes.map((note) => /* @__PURE__ */ jsxs(
1011
+ documents.length === 0 ? /* @__PURE__ */ jsxs("div", { className: "text-center py-8 text-muted-foreground", children: [
1012
+ /* @__PURE__ */ jsx(FileText, { className: "h-8 w-8 mx-auto mb-2 opacity-50" }),
1013
+ /* @__PURE__ */ jsx("p", { children: "No documents uploaded yet" })
1014
+ ] }) : /* @__PURE__ */ jsx("div", { className: "space-y-2", children: documents.map((doc) => /* @__PURE__ */ jsxs(
801
1015
  "div",
802
1016
  {
803
- className: "border rounded-lg p-4 bg-muted/30",
1017
+ className: "border rounded-lg hover:bg-muted/30 transition-colors overflow-hidden",
804
1018
  children: [
805
- /* @__PURE__ */ jsxs("div", { className: "flex items-start justify-between gap-4 mb-2", children: [
806
- /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
807
- /* @__PURE__ */ jsx("p", { className: "font-medium text-sm text-foreground", children: note.user }),
808
- /* @__PURE__ */ jsx(Badge, { variant: note.type === "RFI Note" ? "default" : "outline", children: note.type })
809
- ] }),
810
- /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
811
- /* @__PURE__ */ jsx("span", { className: "text-xs text-muted-foreground whitespace-nowrap", children: note.timestamp }),
812
- /* @__PURE__ */ jsx(
813
- Button,
814
- {
815
- variant: "ghost",
816
- size: "sm",
817
- className: "h-8 w-8 p-0 text-muted-foreground hover:text-foreground",
818
- onClick: () => handleDeleteNote(note.id, note.content),
819
- children: /* @__PURE__ */ jsx(Trash2, { className: "h-4 w-4" })
820
- }
821
- )
822
- ] })
823
- ] }),
824
- /* @__PURE__ */ jsx("p", { className: "text-sm text-foreground", children: note.content })
825
- ]
826
- },
827
- note.id
828
- )) })
829
- ] })
830
- ] });
831
- };
832
- var AlertTimeline = ({ events }) => {
833
- const getIcon = (action) => {
834
- if (action.includes("Created")) return /* @__PURE__ */ jsx(Circle, { className: "h-4 w-4" });
835
- if (action.includes("Assigned")) return /* @__PURE__ */ jsx(UserPlus, { className: "h-4 w-4" });
836
- if (action.includes("Updated") || action.includes("Modified")) return /* @__PURE__ */ jsx(Edit, { className: "h-4 w-4" });
837
- if (action.includes("Closed") || action.includes("Resolved")) return /* @__PURE__ */ jsx(CheckCircle, { className: "h-4 w-4" });
838
- if (action.includes("Rejected")) return /* @__PURE__ */ jsx(XCircle, { className: "h-4 w-4" });
839
- return /* @__PURE__ */ jsx(Circle, { className: "h-4 w-4" });
840
- };
841
- const getStatusColor = (status) => {
842
- switch (status) {
843
- case "Unassigned":
844
- return "text-destructive";
845
- case "Closed":
846
- return "text-success";
847
- case "In Progress":
848
- return "text-warning";
849
- default:
850
- return "text-muted-foreground";
851
- }
852
- };
853
- if (events.length === 0) {
854
- return /* @__PURE__ */ jsx("div", { className: "text-center py-8 text-muted-foreground", children: "No timeline events yet" });
855
- }
856
- return /* @__PURE__ */ jsx("div", { className: "space-y-3", children: events.map((event, index) => /* @__PURE__ */ jsxs("div", { className: "relative pl-6 pb-3", children: [
857
- index !== events.length - 1 && /* @__PURE__ */ jsx("div", { className: "absolute left-[7px] top-5 bottom-0 w-[2px] bg-border" }),
858
- /* @__PURE__ */ jsx("div", { className: cn(
859
- "absolute left-0 top-0 flex-none",
860
- getStatusColor(event.status)
861
- ), children: /* @__PURE__ */ jsx("div", { className: "h-4 w-4", children: getIcon(event.action) }) }),
862
- /* @__PURE__ */ jsxs("div", { className: "space-y-0.5", children: [
863
- /* @__PURE__ */ jsx("p", { className: "text-xs font-medium text-foreground", children: event.action }),
864
- /* @__PURE__ */ jsxs("p", { className: "text-xs text-muted-foreground", children: [
865
- "by ",
866
- event.user
867
- ] }),
868
- event.details && /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: event.details }),
869
- event.status && /* @__PURE__ */ jsxs("p", { className: cn("text-xs font-medium", getStatusColor(event.status)), children: [
870
- "Status: ",
871
- event.status
872
- ] }),
873
- /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground/70 pt-0.5", children: event.timestamp })
874
- ] })
875
- ] }, event.id)) });
876
- };
877
- var cardVariants = cva(
878
- "rounded-lg border bg-card text-card-foreground transition-all duration-200",
879
- {
880
- variants: {
881
- variant: {
882
- default: "shadow-sm",
883
- elevated: "shadow-md hover:shadow-lg",
884
- outlined: "border-2 shadow-none",
885
- ghost: "border-transparent shadow-none bg-transparent",
886
- subtle: "border-border/75 shadow-none"
887
- },
888
- size: {
889
- sm: "p-3",
890
- md: "p-4",
891
- lg: "p-6",
892
- none: "p-0"
893
- },
894
- fullHeight: {
895
- true: "h-full flex flex-col",
896
- false: ""
897
- },
898
- interactive: {
899
- true: "cursor-pointer hover:shadow-md hover:scale-[1.02]",
900
- false: ""
901
- }
902
- },
903
- defaultVariants: {
904
- variant: "default",
905
- size: "none",
906
- fullHeight: false,
907
- interactive: false
908
- }
909
- }
910
- );
911
- var Card = React13.forwardRef(
912
- ({ className, variant, size, fullHeight, interactive, ...props }, ref) => /* @__PURE__ */ jsx(
913
- "div",
914
- {
915
- ref,
916
- className: cn(cardVariants({ variant, size, fullHeight, interactive }), className),
917
- ...props
918
- }
919
- )
920
- );
921
- Card.displayName = "Card";
922
- var cardHeaderVariants = cva(
923
- "flex flex-col space-y-1.5",
924
- {
925
- variants: {
926
- size: {
927
- sm: "px-3 pt-3 pb-2",
928
- md: "px-4 pt-4 pb-3",
929
- lg: "px-6 pt-6 pb-4"
930
- },
931
- align: {
932
- start: "items-start",
933
- center: "items-center",
934
- end: "items-end"
935
- },
936
- direction: {
937
- row: "flex-row justify-between items-center space-y-0 space-x-4",
938
- column: "flex-col space-y-1.5"
939
- }
940
- },
941
- defaultVariants: {
942
- size: "lg",
943
- align: "start",
944
- direction: "column"
945
- }
946
- }
947
- );
948
- var CardHeader = React13.forwardRef(
949
- ({ className, size, align, direction, ...props }, ref) => /* @__PURE__ */ jsx(
950
- "div",
951
- {
952
- ref,
953
- className: cn(cardHeaderVariants({ size, align, direction }), className),
954
- ...props
955
- }
956
- )
957
- );
958
- CardHeader.displayName = "CardHeader";
959
- var cardTitleVariants = cva(
960
- "font-semibold leading-none tracking-tight",
961
- {
962
- variants: {
963
- size: {
964
- sm: "text-base",
965
- md: "text-lg",
966
- lg: "text-xl"
967
- }
968
- },
969
- defaultVariants: {
970
- size: "md"
971
- }
972
- }
973
- );
974
- var CardTitle = React13.forwardRef(
975
- ({ className, size, ...props }, ref) => /* @__PURE__ */ jsx(
976
- "h3",
977
- {
978
- ref,
979
- className: cn(cardTitleVariants({ size }), className),
980
- ...props
981
- }
982
- )
983
- );
984
- CardTitle.displayName = "CardTitle";
985
- var CardDescription = React13.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
986
- "p",
987
- {
988
- ref,
989
- className: cn("text-sm text-muted-foreground", className),
990
- ...props
991
- }
992
- ));
993
- CardDescription.displayName = "CardDescription";
994
- var cardContentVariants = cva(
995
- "",
996
- {
997
- variants: {
998
- size: {
999
- sm: "px-3 pb-2",
1000
- md: "px-4 pb-3",
1001
- lg: "px-6 pb-4"
1002
- },
1003
- fullHeight: {
1004
- true: "flex-1",
1005
- false: ""
1006
- }
1007
- },
1008
- defaultVariants: {
1009
- size: "lg",
1010
- fullHeight: false
1011
- }
1012
- }
1013
- );
1014
- var CardContent = React13.forwardRef(
1015
- ({ className, size, fullHeight, ...props }, ref) => /* @__PURE__ */ jsx(
1016
- "div",
1017
- {
1018
- ref,
1019
- className: cn(cardContentVariants({ size, fullHeight }), className),
1020
- ...props
1021
- }
1022
- )
1023
- );
1024
- CardContent.displayName = "CardContent";
1025
- var cardFooterVariants = cva(
1026
- "flex items-center pt-0",
1027
- {
1028
- variants: {
1029
- size: {
1030
- sm: "p-3 pt-0",
1031
- md: "p-4 pt-0",
1032
- lg: "p-6 pt-0"
1033
- },
1034
- justify: {
1035
- start: "justify-start",
1036
- center: "justify-center",
1037
- end: "justify-end",
1038
- between: "justify-between"
1039
- }
1040
- },
1041
- defaultVariants: {
1042
- size: "lg",
1043
- justify: "start"
1044
- }
1045
- }
1046
- );
1047
- var CardFooter = React13.forwardRef(
1048
- ({ className, size, justify, ...props }, ref) => /* @__PURE__ */ jsx(
1049
- "div",
1050
- {
1051
- ref,
1052
- className: cn(cardFooterVariants({ size, justify }), className),
1053
- ...props
1054
- }
1055
- )
1056
- );
1057
- CardFooter.displayName = "CardFooter";
1058
- var FormCard = React13.forwardRef(
1059
- ({ title, description, children, headerActions, className, variant = "default", ...props }, ref) => /* @__PURE__ */ jsxs(
1060
- Card,
1061
- {
1062
- ref,
1063
- variant,
1064
- fullHeight: true,
1065
- className: cn("", className),
1066
- ...props,
1067
- children: [
1068
- /* @__PURE__ */ jsxs(
1069
- CardHeader,
1070
- {
1071
- direction: headerActions ? "row" : "column",
1072
- size: "md",
1073
- children: [
1074
- /* @__PURE__ */ jsx("div", { className: "space-y-1", children: /* @__PURE__ */ jsx(CardTitle, { size: "md", children: title }) }),
1075
- headerActions && /* @__PURE__ */ jsx("div", { className: "flex items-center gap-2", children: headerActions })
1076
- ]
1077
- }
1078
- ),
1079
- /* @__PURE__ */ jsx(CardContent, { size: "md", fullHeight: true, children })
1080
- ]
1081
- }
1082
- )
1083
- );
1084
- FormCard.displayName = "FormCard";
1019
+ isImageType(doc.name) && doc.url && /* @__PURE__ */ jsx("div", { className: "w-full bg-muted/50", children: /* @__PURE__ */ jsx(
1020
+ "img",
1021
+ {
1022
+ src: doc.url,
1023
+ alt: doc.name,
1024
+ className: "w-full h-48 object-cover"
1025
+ }
1026
+ ) }),
1027
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between p-3", children: [
1028
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3 flex-1 min-w-0", children: [
1029
+ !isImageType(doc.name) && /* @__PURE__ */ jsx("div", { className: cn(getFileTypeColor(doc.type)), children: getFileIcon(doc.type) }),
1030
+ /* @__PURE__ */ jsxs("div", { className: "flex-1 min-w-0", children: [
1031
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
1032
+ /* @__PURE__ */ jsx("h4", { className: "font-medium text-sm truncate", children: doc.name }),
1033
+ /* @__PURE__ */ jsx("span", { className: cn("text-xs px-2 py-0.5 rounded-full bg-muted", getFileTypeColor(doc.type)), children: doc.type })
1034
+ ] }),
1035
+ doc.description && /* @__PURE__ */ jsx("p", { className: "text-sm text-foreground mt-1", children: doc.description }),
1036
+ /* @__PURE__ */ jsxs("p", { className: "text-xs text-muted-foreground mt-1", children: [
1037
+ doc.size,
1038
+ " \u2022 Uploaded by ",
1039
+ doc.uploadedBy,
1040
+ " \u2022 ",
1041
+ new Date(doc.uploadedAt).toLocaleDateString()
1042
+ ] })
1043
+ ] })
1044
+ ] }),
1045
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1", children: [
1046
+ /* @__PURE__ */ jsx(
1047
+ Button,
1048
+ {
1049
+ variant: "ghost",
1050
+ size: "sm",
1051
+ className: "h-8 w-8 p-0",
1052
+ onClick: () => toast({ title: "Preview", description: `Viewing ${doc.name}` }),
1053
+ children: /* @__PURE__ */ jsx(Eye, { className: "h-4 w-4" })
1054
+ }
1055
+ ),
1056
+ /* @__PURE__ */ jsx(
1057
+ Button,
1058
+ {
1059
+ variant: "ghost",
1060
+ size: "sm",
1061
+ className: "h-8 w-8 p-0",
1062
+ onClick: () => toast({ title: "Download", description: `Downloading ${doc.name}` }),
1063
+ children: /* @__PURE__ */ jsx(Download, { className: "h-4 w-4" })
1064
+ }
1065
+ ),
1066
+ /* @__PURE__ */ jsx(
1067
+ Button,
1068
+ {
1069
+ variant: "ghost",
1070
+ size: "sm",
1071
+ className: "h-8 w-8 p-0 text-muted-foreground hover:text-foreground",
1072
+ onClick: () => toast({ title: "Delete", description: `Deleted ${doc.name}` }),
1073
+ children: /* @__PURE__ */ jsx(Trash2, { className: "h-4 w-4" })
1074
+ }
1075
+ )
1076
+ ] })
1077
+ ] })
1078
+ ]
1079
+ },
1080
+ doc.id
1081
+ )) })
1082
+ ] })
1083
+ ] });
1084
+ };
1085
1085
  var InfoField = ({ label, value, layout = "vertical", className }) => {
1086
1086
  if (layout === "horizontal") {
1087
1087
  return /* @__PURE__ */ jsxs("div", { className: `flex items-start gap-3 ${className || ""}`, children: [
@@ -1394,6 +1394,184 @@ var ContextSection = ({ alert }) => {
1394
1394
  ] }) })
1395
1395
  ] });
1396
1396
  };
1397
+ var EditableInfoField = ({
1398
+ label,
1399
+ value,
1400
+ options,
1401
+ onChange,
1402
+ placeholder = "Select...",
1403
+ renderValue,
1404
+ className
1405
+ }) => {
1406
+ const [isEditing, setIsEditing] = useState(false);
1407
+ const handleChange = (newValue) => {
1408
+ onChange(newValue);
1409
+ setIsEditing(false);
1410
+ };
1411
+ if (isEditing) {
1412
+ return /* @__PURE__ */ jsx("div", { className, children: /* @__PURE__ */ jsx(
1413
+ EnhancedSelect,
1414
+ {
1415
+ label,
1416
+ value: value || "",
1417
+ onValueChange: handleChange,
1418
+ options,
1419
+ placeholder
1420
+ }
1421
+ ) });
1422
+ }
1423
+ const displayValue = value ? renderValue ? renderValue(value) : value : placeholder;
1424
+ return /* @__PURE__ */ jsx(
1425
+ "div",
1426
+ {
1427
+ className: cn("cursor-pointer transition-colors hover:bg-muted/50 rounded-md -mx-2 px-2 -my-1 py-1", className),
1428
+ onClick: () => setIsEditing(true),
1429
+ role: "button",
1430
+ tabIndex: 0,
1431
+ onKeyDown: (e) => {
1432
+ if (e.key === "Enter" || e.key === " ") {
1433
+ e.preventDefault();
1434
+ setIsEditing(true);
1435
+ }
1436
+ },
1437
+ children: /* @__PURE__ */ jsx(InfoField, { label, value: displayValue })
1438
+ }
1439
+ );
1440
+ };
1441
+
1442
+ // src/lib/utils/alert-utils.ts
1443
+ var getTypeBadgeVariant = (type) => {
1444
+ switch (type) {
1445
+ case "Ofac":
1446
+ return "alert-ofac";
1447
+ case "Dual Approval":
1448
+ return "alert-dual";
1449
+ case "Transaction Monitoring":
1450
+ return "alert-monitoring";
1451
+ case "Transaction Processing Error":
1452
+ return "alert-error";
1453
+ default:
1454
+ return "outline";
1455
+ }
1456
+ };
1457
+ var getStatusColor = (status) => {
1458
+ switch (status) {
1459
+ case "Unassigned":
1460
+ return "text-destructive";
1461
+ case "Closed":
1462
+ return "text-success";
1463
+ case "In Progress":
1464
+ return "text-warning";
1465
+ default:
1466
+ return "";
1467
+ }
1468
+ };
1469
+
1470
+ // src/lib/constants.ts
1471
+ var COUNTRY_OPTIONS = [
1472
+ { value: "US", label: "United States" },
1473
+ { value: "CA", label: "Canada" },
1474
+ { value: "GB", label: "United Kingdom" },
1475
+ { value: "DE", label: "Germany" },
1476
+ { value: "FR", label: "France" }
1477
+ ];
1478
+ var FI_ID_TYPE_OPTIONS = [
1479
+ { value: "bic", label: "BIC" },
1480
+ { value: "swift", label: "SWIFT" },
1481
+ { value: "aba", label: "ABA" },
1482
+ { value: "iban", label: "IBAN" },
1483
+ { value: "routing", label: "Routing Number" }
1484
+ ];
1485
+ var ADDRESS_TYPE_OPTIONS = {
1486
+ FI: [
1487
+ { value: "headquarters", label: "Headquarters" },
1488
+ { value: "branch", label: "Branch Office" },
1489
+ { value: "correspondent", label: "Correspondent Bank" }
1490
+ ]
1491
+ };
1492
+ var RFI_STATUS_OPTIONS = [
1493
+ { value: "Completed", label: "Completed" },
1494
+ { value: "Provided", label: "Provided" },
1495
+ { value: "Pending", label: "Pending" }
1496
+ ];
1497
+ var ASSIGNEE_OPTIONS = [
1498
+ { value: "John Smith", label: "John Smith" },
1499
+ { value: "Sarah Johnson", label: "Sarah Johnson" },
1500
+ { value: "Michael Chen", label: "Michael Chen" },
1501
+ { value: "approverdev", label: "approverdev" },
1502
+ { value: "Unassigned", label: "Unassigned" }
1503
+ ];
1504
+ var AlertDetailView = ({
1505
+ alert,
1506
+ rfiStatus,
1507
+ assignee,
1508
+ onRfiStatusChange,
1509
+ onAssigneeChange
1510
+ }) => {
1511
+ return /* @__PURE__ */ jsxs("div", { className: "flex flex-col lg:flex-row gap-6", children: [
1512
+ /* @__PURE__ */ jsxs("div", { className: "flex-1 grid grid-cols-1 lg:grid-cols-2 gap-6", children: [
1513
+ /* @__PURE__ */ jsx(
1514
+ FormCard,
1515
+ {
1516
+ title: "Alert Information",
1517
+ headerActions: /* @__PURE__ */ jsx(Button, { variant: "ghost", size: "sm", children: /* @__PURE__ */ jsx(Edit, { className: "h-4 w-4" }) }),
1518
+ children: /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
1519
+ /* @__PURE__ */ jsx(InfoField, { label: "Alert ID", value: alert.id }),
1520
+ /* @__PURE__ */ jsx(
1521
+ InfoField,
1522
+ {
1523
+ label: "Type",
1524
+ value: /* @__PURE__ */ jsx(Badge, { variant: getTypeBadgeVariant(alert.type), children: alert.type })
1525
+ }
1526
+ ),
1527
+ /* @__PURE__ */ jsx(
1528
+ InfoField,
1529
+ {
1530
+ label: "Status",
1531
+ value: /* @__PURE__ */ jsx("span", { className: cn("font-medium", getStatusColor(alert.status)), children: alert.status })
1532
+ }
1533
+ ),
1534
+ /* @__PURE__ */ jsx(InfoField, { label: "Created At", value: alert.createdAt }),
1535
+ /* @__PURE__ */ jsx(
1536
+ InfoField,
1537
+ {
1538
+ label: "Context Type",
1539
+ value: /* @__PURE__ */ jsx(Badge, { variant: "outline", children: alert.contextType })
1540
+ }
1541
+ ),
1542
+ /* @__PURE__ */ jsx(InfoField, { label: "Context ID", value: alert.contextId || "N/A" }),
1543
+ /* @__PURE__ */ jsx(
1544
+ EditableInfoField,
1545
+ {
1546
+ label: "Assignee",
1547
+ value: assignee,
1548
+ options: ASSIGNEE_OPTIONS,
1549
+ onChange: onAssigneeChange,
1550
+ placeholder: "Unassigned"
1551
+ }
1552
+ ),
1553
+ /* @__PURE__ */ jsx(
1554
+ EditableInfoField,
1555
+ {
1556
+ label: "RFI Status",
1557
+ value: rfiStatus,
1558
+ options: RFI_STATUS_OPTIONS,
1559
+ onChange: onRfiStatusChange,
1560
+ placeholder: "Select status",
1561
+ renderValue: (value) => /* @__PURE__ */ jsx(Badge, { variant: "success", children: value })
1562
+ }
1563
+ ),
1564
+ /* @__PURE__ */ jsx("div", { className: "col-span-2", children: /* @__PURE__ */ jsx(InfoField, { label: "Description", value: alert.description }) })
1565
+ ] })
1566
+ }
1567
+ ),
1568
+ /* @__PURE__ */ jsx(ContextSection, { alert }),
1569
+ /* @__PURE__ */ jsx(FormCard, { title: "Notes", children: /* @__PURE__ */ jsx(AlertNotes, { alertId: alert.id, notes: alert.notes || [] }) }),
1570
+ /* @__PURE__ */ jsx(FormCard, { title: "Documents", children: /* @__PURE__ */ jsx(AlertDocuments, { alertId: alert.id, documents: alert.documents || [] }) })
1571
+ ] }),
1572
+ /* @__PURE__ */ jsx("div", { className: "lg:w-64", children: /* @__PURE__ */ jsx(FormCard, { title: "Status Timeline", className: "h-full", children: /* @__PURE__ */ jsx(AlertTimeline, { events: alert.timeline || [] }) }) })
1573
+ ] });
1574
+ };
1397
1575
 
1398
1576
  // src/assets/braid-logo.png
1399
1577
  var braid_logo_default = "./braid-logo-343BOQZ2.png";
@@ -2911,9 +3089,14 @@ var businessProfileSchema = z.object({
2911
3089
  dbaName: z.string().optional(),
2912
3090
  businessType: z.string().min(1, "Business type is required"),
2913
3091
  taxId: z.string().min(1, "Tax ID is required"),
2914
- businessPhone: z.string().min(1, "Business phone is required"),
2915
- businessEmail: z.string().email("Invalid email format"),
3092
+ formationDate: z.string().optional(),
3093
+ idType: z.string().optional(),
3094
+ incorporationState: z.string().optional(),
2916
3095
  website: z.string().url("Invalid URL format").optional().or(z.literal("")),
3096
+ contactFirstName: z.string().optional(),
3097
+ contactLastName: z.string().optional(),
3098
+ contactEmail: z.string().optional(),
3099
+ contactPhone: z.string().optional(),
2917
3100
  address: addressSchema
2918
3101
  });
2919
3102
  z.object({
@@ -3057,29 +3240,6 @@ var ACHTransferSection = ({ isEditing, onToggleEdit, className, hideActions }) =
3057
3240
  }
3058
3241
  );
3059
3242
  };
3060
-
3061
- // src/lib/constants.ts
3062
- var COUNTRY_OPTIONS = [
3063
- { value: "US", label: "United States" },
3064
- { value: "CA", label: "Canada" },
3065
- { value: "GB", label: "United Kingdom" },
3066
- { value: "DE", label: "Germany" },
3067
- { value: "FR", label: "France" }
3068
- ];
3069
- var FI_ID_TYPE_OPTIONS = [
3070
- { value: "bic", label: "BIC" },
3071
- { value: "swift", label: "SWIFT" },
3072
- { value: "aba", label: "ABA" },
3073
- { value: "iban", label: "IBAN" },
3074
- { value: "routing", label: "Routing Number" }
3075
- ];
3076
- var ADDRESS_TYPE_OPTIONS = {
3077
- FI: [
3078
- { value: "headquarters", label: "Headquarters" },
3079
- { value: "branch", label: "Branch Office" },
3080
- { value: "correspondent", label: "Correspondent Bank" }
3081
- ]
3082
- };
3083
3243
  var AddressForm = ({
3084
3244
  title,
3085
3245
  description,
@@ -3624,8 +3784,9 @@ var defaultBusinessProfile = {
3624
3784
  dbaName: "ACME Tech",
3625
3785
  businessType: "corporation",
3626
3786
  taxId: "12-3456789",
3627
- businessPhone: "+1 (555) 123-4567",
3628
- businessEmail: "contact@acme.com",
3787
+ formationDate: "2020-01-15",
3788
+ idType: "EIN",
3789
+ incorporationState: "Delaware",
3629
3790
  website: "https://acme.com",
3630
3791
  address: {
3631
3792
  streetAddress: "123 Business Avenue",
@@ -3652,75 +3813,176 @@ var BusinessProfileCard = ({
3652
3813
  onToggleEdit,
3653
3814
  onSave: onDataChange
3654
3815
  });
3655
- const editContent = /* @__PURE__ */ jsx(FormProvider, { form, children: /* @__PURE__ */ jsx("div", { className: "space-y-6", children: /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-6", children: [
3656
- /* @__PURE__ */ jsx(
3657
- FormInput,
3658
- {
3659
- name: "legalName",
3660
- label: "Legal Name",
3661
- placeholder: "Enter legal business name",
3662
- required: true
3663
- }
3664
- ),
3665
- /* @__PURE__ */ jsx(
3666
- FormInput,
3667
- {
3668
- name: "dbaName",
3669
- label: "DBA Name",
3670
- placeholder: "Enter doing business as name"
3671
- }
3672
- ),
3673
- /* @__PURE__ */ jsx(
3674
- FormSelect,
3675
- {
3676
- name: "businessType",
3677
- label: "Business Type",
3678
- placeholder: "Select business type",
3679
- options: [
3680
- { value: "corporation", label: "Corporation" },
3681
- { value: "llc", label: "LLC" },
3682
- { value: "partnership", label: "Partnership" },
3683
- { value: "sole_proprietorship", label: "Sole Proprietorship" }
3684
- ]
3685
- }
3686
- ),
3687
- /* @__PURE__ */ jsx(
3688
- FormInput,
3689
- {
3690
- name: "taxId",
3691
- label: "Tax ID",
3692
- placeholder: "Enter tax identification number",
3693
- required: true
3694
- }
3695
- ),
3696
- /* @__PURE__ */ jsx(
3697
- FormInput,
3698
- {
3699
- name: "businessPhone",
3700
- label: "Business Phone",
3701
- placeholder: "Enter business phone number",
3702
- required: true
3703
- }
3704
- ),
3705
- /* @__PURE__ */ jsx(
3706
- FormInput,
3707
- {
3708
- name: "businessEmail",
3709
- label: "Business Email",
3710
- type: "email",
3711
- placeholder: "Enter business email",
3712
- required: true
3713
- }
3714
- ),
3715
- /* @__PURE__ */ jsx(
3716
- FormInput,
3717
- {
3718
- name: "website",
3719
- label: "Website",
3720
- placeholder: "Enter website URL"
3721
- }
3722
- )
3723
- ] }) }) });
3816
+ const editContent = /* @__PURE__ */ jsx(FormProvider, { form, children: /* @__PURE__ */ jsxs("div", { className: "space-y-6", children: [
3817
+ /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-6", children: [
3818
+ /* @__PURE__ */ jsx(
3819
+ FormInput,
3820
+ {
3821
+ name: "legalName",
3822
+ label: "Legal Name",
3823
+ placeholder: "Enter legal business name",
3824
+ required: true
3825
+ }
3826
+ ),
3827
+ /* @__PURE__ */ jsx(
3828
+ FormInput,
3829
+ {
3830
+ name: "dbaName",
3831
+ label: "DBA Name",
3832
+ placeholder: "Enter doing business as name"
3833
+ }
3834
+ ),
3835
+ /* @__PURE__ */ jsx(
3836
+ FormSelect,
3837
+ {
3838
+ name: "businessType",
3839
+ label: "Business Type",
3840
+ placeholder: "Select business type",
3841
+ options: [
3842
+ { value: "corporation", label: "Corporation" },
3843
+ { value: "llc", label: "LLC" },
3844
+ { value: "partnership", label: "Partnership" },
3845
+ { value: "sole_proprietorship", label: "Sole Proprietorship" }
3846
+ ]
3847
+ }
3848
+ ),
3849
+ /* @__PURE__ */ jsx(
3850
+ FormInput,
3851
+ {
3852
+ name: "taxId",
3853
+ label: "Tax ID",
3854
+ placeholder: "Enter tax identification number",
3855
+ required: true
3856
+ }
3857
+ ),
3858
+ /* @__PURE__ */ jsx(
3859
+ FormInput,
3860
+ {
3861
+ name: "formationDate",
3862
+ label: "Formation Date",
3863
+ type: "date",
3864
+ placeholder: "Enter formation date"
3865
+ }
3866
+ ),
3867
+ /* @__PURE__ */ jsx(
3868
+ FormSelect,
3869
+ {
3870
+ name: "idType",
3871
+ label: "ID Type",
3872
+ placeholder: "Select ID type",
3873
+ options: [
3874
+ { value: "ein", label: "EIN" },
3875
+ { value: "ssn", label: "SSN" },
3876
+ { value: "itin", label: "ITIN" }
3877
+ ]
3878
+ }
3879
+ ),
3880
+ /* @__PURE__ */ jsx(
3881
+ FormInput,
3882
+ {
3883
+ name: "incorporationState",
3884
+ label: "Incorporation State",
3885
+ placeholder: "Enter incorporation state"
3886
+ }
3887
+ ),
3888
+ /* @__PURE__ */ jsx(
3889
+ FormInput,
3890
+ {
3891
+ name: "website",
3892
+ label: "Website",
3893
+ placeholder: "Enter website URL"
3894
+ }
3895
+ )
3896
+ ] }),
3897
+ /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-1 gap-4", children: [
3898
+ /* @__PURE__ */ jsx(
3899
+ FormInput,
3900
+ {
3901
+ name: "address.streetAddress",
3902
+ label: "Street Address",
3903
+ placeholder: "Enter street address"
3904
+ }
3905
+ ),
3906
+ /* @__PURE__ */ jsx(
3907
+ FormInput,
3908
+ {
3909
+ name: "address.apartment",
3910
+ label: "Apartment, suite, or floor",
3911
+ placeholder: "Enter apartment, suite, or floor"
3912
+ }
3913
+ )
3914
+ ] }),
3915
+ /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-6", children: [
3916
+ /* @__PURE__ */ jsx(
3917
+ FormInput,
3918
+ {
3919
+ name: "address.city",
3920
+ label: "City",
3921
+ placeholder: "Enter city"
3922
+ }
3923
+ ),
3924
+ /* @__PURE__ */ jsx(
3925
+ FormInput,
3926
+ {
3927
+ name: "address.state",
3928
+ label: "State",
3929
+ placeholder: "Enter state"
3930
+ }
3931
+ ),
3932
+ /* @__PURE__ */ jsx(
3933
+ FormInput,
3934
+ {
3935
+ name: "address.postalCode",
3936
+ label: "Postal Code",
3937
+ placeholder: "Enter postal code"
3938
+ }
3939
+ ),
3940
+ /* @__PURE__ */ jsx(
3941
+ FormInput,
3942
+ {
3943
+ name: "address.country",
3944
+ label: "Country Code",
3945
+ placeholder: "Enter country code"
3946
+ }
3947
+ )
3948
+ ] }),
3949
+ /* @__PURE__ */ jsx("h4", { className: "text-sm font-medium text-muted-foreground mt-6", children: "Contact Person" }),
3950
+ /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-6", children: [
3951
+ /* @__PURE__ */ jsx(
3952
+ FormInput,
3953
+ {
3954
+ name: "contactFirstName",
3955
+ label: "First Name",
3956
+ placeholder: "Enter first name"
3957
+ }
3958
+ ),
3959
+ /* @__PURE__ */ jsx(
3960
+ FormInput,
3961
+ {
3962
+ name: "contactLastName",
3963
+ label: "Last Name",
3964
+ placeholder: "Enter last name"
3965
+ }
3966
+ ),
3967
+ /* @__PURE__ */ jsx(
3968
+ FormInput,
3969
+ {
3970
+ name: "contactEmail",
3971
+ label: "Email",
3972
+ type: "email",
3973
+ placeholder: "Enter email"
3974
+ }
3975
+ ),
3976
+ /* @__PURE__ */ jsx(
3977
+ FormInput,
3978
+ {
3979
+ name: "contactPhone",
3980
+ label: "Phone Number",
3981
+ placeholder: "Enter phone number"
3982
+ }
3983
+ )
3984
+ ] })
3985
+ ] }) });
3724
3986
  const formValues = form.watch();
3725
3987
  const viewContent = /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
3726
3988
  /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
@@ -3732,10 +3994,30 @@ var BusinessProfileCard = ({
3732
3994
  /* @__PURE__ */ jsx(InfoField, { label: "Tax ID", value: formValues?.taxId, layout: "horizontal" })
3733
3995
  ] }),
3734
3996
  /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
3735
- /* @__PURE__ */ jsx(InfoField, { label: "Business Phone", value: formValues?.businessPhone, layout: "horizontal" }),
3736
- /* @__PURE__ */ jsx(InfoField, { label: "Business Email", value: formValues?.businessEmail, layout: "horizontal" })
3997
+ /* @__PURE__ */ jsx(InfoField, { label: "Formation Date", value: formValues?.formationDate || "2020-01-15", layout: "horizontal" }),
3998
+ /* @__PURE__ */ jsx(InfoField, { label: "ID Type", value: formValues?.idType || "EIN", layout: "horizontal" })
3999
+ ] }),
4000
+ /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
4001
+ /* @__PURE__ */ jsx(InfoField, { label: "Incorporation State", value: formValues?.incorporationState || "Delaware", layout: "horizontal" }),
4002
+ /* @__PURE__ */ jsx(InfoField, { label: "Website", value: formValues?.website, layout: "horizontal" })
4003
+ ] }),
4004
+ /* @__PURE__ */ jsx(
4005
+ InfoField,
4006
+ {
4007
+ label: "Address",
4008
+ value: formValues?.address ? `${formValues.address.streetAddress}${formValues.address.apartment ? ", " + formValues.address.apartment : ""}, ${formValues.address.city}, ${formValues.address.state} ${formValues.address.postalCode}, ${formValues.address.country}` : "123 Business Avenue, Suite 100, New York, NY 10001, US",
4009
+ layout: "horizontal"
4010
+ }
4011
+ ),
4012
+ /* @__PURE__ */ jsx("h4", { className: "text-sm font-medium text-muted-foreground mt-6", children: "Contact Person" }),
4013
+ /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
4014
+ /* @__PURE__ */ jsx(InfoField, { label: "First Name", value: formValues?.contactFirstName || "John", layout: "horizontal" }),
4015
+ /* @__PURE__ */ jsx(InfoField, { label: "Last Name", value: formValues?.contactLastName || "Smith", layout: "horizontal" })
3737
4016
  ] }),
3738
- /* @__PURE__ */ jsx("div", { className: "grid grid-cols-2 gap-4", children: /* @__PURE__ */ jsx(InfoField, { label: "Website", value: formValues?.website, layout: "horizontal" }) })
4017
+ /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
4018
+ /* @__PURE__ */ jsx(InfoField, { label: "Email", value: formValues?.contactEmail || "john.smith@acme.com", layout: "horizontal" }),
4019
+ /* @__PURE__ */ jsx(InfoField, { label: "Phone Number", value: formValues?.contactPhone || "+1 (555) 123-4567", layout: "horizontal" })
4020
+ ] })
3739
4021
  ] });
3740
4022
  return /* @__PURE__ */ jsx(
3741
4023
  EditableFormCard,
@@ -3753,30 +4035,75 @@ var BusinessProfileCard = ({
3753
4035
  }
3754
4036
  );
3755
4037
  };
4038
+ var mockBusinessTimeline = [
4039
+ {
4040
+ id: "1",
4041
+ action: "Business Created",
4042
+ user: "admin",
4043
+ details: "Initial business setup",
4044
+ status: "Active",
4045
+ timestamp: "2025-08-03 10:30:00"
4046
+ },
4047
+ {
4048
+ id: "2",
4049
+ action: "Profile Updated",
4050
+ user: "admin",
4051
+ details: "Updated business information",
4052
+ timestamp: "2025-09-05 14:22:00"
4053
+ },
4054
+ {
4055
+ id: "3",
4056
+ action: "OFAC Check Completed",
4057
+ user: "System",
4058
+ details: "Automated compliance check",
4059
+ status: "Verified",
4060
+ timestamp: "2025-09-05 14:30:00"
4061
+ }
4062
+ ];
3756
4063
  var BusinessStatusCard = ({ isEditing, onToggleEdit, className }) => {
4064
+ const getIcon = (action) => {
4065
+ if (action.includes("Created")) return /* @__PURE__ */ jsx(Circle, { className: "h-4 w-4" });
4066
+ if (action.includes("Assigned")) return /* @__PURE__ */ jsx(UserPlus, { className: "h-4 w-4" });
4067
+ if (action.includes("Updated") || action.includes("Modified") || action.includes("Check")) return /* @__PURE__ */ jsx(Edit, { className: "h-4 w-4" });
4068
+ if (action.includes("Completed") || action.includes("Verified")) return /* @__PURE__ */ jsx(CheckCircle, { className: "h-4 w-4" });
4069
+ return /* @__PURE__ */ jsx(Circle, { className: "h-4 w-4" });
4070
+ };
4071
+ const getStatusColor2 = (status) => {
4072
+ switch (status) {
4073
+ case "Active":
4074
+ case "Verified":
4075
+ return "text-success";
4076
+ case "Pending":
4077
+ return "text-warning";
4078
+ default:
4079
+ return "text-muted-foreground";
4080
+ }
4081
+ };
3757
4082
  return /* @__PURE__ */ jsx(
3758
4083
  FormCard,
3759
4084
  {
3760
- title: "Business Status & Records",
4085
+ title: "Timeline",
3761
4086
  className,
3762
- headerActions: /* @__PURE__ */ jsx("div", { className: "flex items-center gap-2", children: isEditing ? /* @__PURE__ */ jsxs(Fragment, { children: [
3763
- /* @__PURE__ */ jsx(Button, { variant: "outline", size: "sm", onClick: onToggleEdit, children: "Cancel" }),
3764
- /* @__PURE__ */ jsx(Button, { size: "sm", onClick: onToggleEdit, children: "Save" })
3765
- ] }) : /* @__PURE__ */ jsx(Button, { variant: "ghost", size: "icon", onClick: onToggleEdit, className: "text-primary hover:text-primary/80 hover:bg-primary/10", children: /* @__PURE__ */ jsx(Edit, { className: "h-4 w-4" }) }) }),
3766
- children: /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
3767
- /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
3768
- /* @__PURE__ */ jsx(InfoField, { label: "Status", value: /* @__PURE__ */ jsx(StatusBadge, { status: "ACTIVE" }), layout: "horizontal" }),
3769
- /* @__PURE__ */ jsx(InfoField, { label: "CIP Status", value: "NOT_START", layout: "horizontal" })
3770
- ] }),
3771
- /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
3772
- /* @__PURE__ */ jsx(InfoField, { label: "Created Date", value: "2025-08-03", layout: "horizontal" }),
3773
- /* @__PURE__ */ jsx(InfoField, { label: "Updated Date", value: "2025-09-05", layout: "horizontal" })
3774
- ] }),
3775
- /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
3776
- /* @__PURE__ */ jsx(InfoField, { label: "Last OFAC Date", value: "2025-09-05", layout: "horizontal" }),
3777
- /* @__PURE__ */ jsx(InfoField, { label: "Last OFAC Status", value: "View Status", layout: "horizontal", className: "text-primary cursor-pointer" })
4087
+ children: /* @__PURE__ */ jsx("div", { className: "space-y-3", children: mockBusinessTimeline.map((event, index) => /* @__PURE__ */ jsxs("div", { className: "relative pl-6 pb-3", children: [
4088
+ index !== mockBusinessTimeline.length - 1 && /* @__PURE__ */ jsx("div", { className: "absolute left-[7px] top-5 bottom-0 w-[2px] bg-border" }),
4089
+ /* @__PURE__ */ jsx("div", { className: cn(
4090
+ "absolute left-0 top-0 flex-none",
4091
+ getStatusColor2(event.status)
4092
+ ), children: /* @__PURE__ */ jsx("div", { className: "h-4 w-4", children: getIcon(event.action) }) }),
4093
+ /* @__PURE__ */ jsxs("div", { className: "space-y-0.5", children: [
4094
+ /* @__PURE__ */ jsx("p", { className: "text-xs font-medium text-foreground", children: event.action }),
4095
+ /* @__PURE__ */ jsxs("p", { className: "text-xs text-muted-foreground", children: [
4096
+ "by ",
4097
+ event.user
4098
+ ] }),
4099
+ event.details && /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: event.details }),
4100
+ event.status && /* @__PURE__ */ jsxs("p", { className: cn("text-xs font-medium", getStatusColor2(event.status)), children: [
4101
+ "Status: ",
4102
+ event.status
4103
+ ] }),
4104
+ /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground/70 pt-0.5", children: event.timestamp })
3778
4105
  ] })
3779
- ] })
4106
+ ] }, event.id)) })
3780
4107
  }
3781
4108
  );
3782
4109
  };
@@ -3801,18 +4128,27 @@ var ContactInfoCard = ({ isEditing, onToggleEdit, className }) => {
3801
4128
  /* @__PURE__ */ jsx(InfoField, { label: "Phone Number", value: "", layout: "horizontal" })
3802
4129
  ] }),
3803
4130
  /* @__PURE__ */ jsx("h4", { className: "text-sm font-medium text-muted-foreground mt-6", children: "Mailing Address" }),
3804
- /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-1 gap-3", children: [
3805
- /* @__PURE__ */ jsx(InfoField, { label: "Street Address", value: "", layout: "horizontal" }),
3806
- /* @__PURE__ */ jsx(InfoField, { label: "Apartment, suite, or floor", value: "", layout: "horizontal" })
3807
- ] }),
3808
- /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
3809
- /* @__PURE__ */ jsx(InfoField, { label: "City", value: "", layout: "horizontal" }),
3810
- /* @__PURE__ */ jsx(InfoField, { label: "State", value: "Alabama", layout: "horizontal" })
3811
- ] }),
3812
- /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
3813
- /* @__PURE__ */ jsx(InfoField, { label: "Postal Code", value: "", layout: "horizontal" }),
3814
- /* @__PURE__ */ jsx(InfoField, { label: "Country Code", value: "US", layout: "horizontal" })
3815
- ] })
4131
+ isEditing ? /* @__PURE__ */ jsxs(Fragment, { children: [
4132
+ /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-1 gap-3", children: [
4133
+ /* @__PURE__ */ jsx(InfoField, { label: "Street Address", value: "", layout: "horizontal" }),
4134
+ /* @__PURE__ */ jsx(InfoField, { label: "Apartment, suite, or floor", value: "", layout: "horizontal" })
4135
+ ] }),
4136
+ /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
4137
+ /* @__PURE__ */ jsx(InfoField, { label: "City", value: "", layout: "horizontal" }),
4138
+ /* @__PURE__ */ jsx(InfoField, { label: "State", value: "Alabama", layout: "horizontal" })
4139
+ ] }),
4140
+ /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
4141
+ /* @__PURE__ */ jsx(InfoField, { label: "Postal Code", value: "", layout: "horizontal" }),
4142
+ /* @__PURE__ */ jsx(InfoField, { label: "Country Code", value: "US", layout: "horizontal" })
4143
+ ] })
4144
+ ] }) : /* @__PURE__ */ jsx(
4145
+ InfoField,
4146
+ {
4147
+ label: "Address",
4148
+ value: "123 Business Avenue, Suite 100, New York, NY 10001, US",
4149
+ layout: "horizontal"
4150
+ }
4151
+ )
3816
4152
  ] })
3817
4153
  }
3818
4154
  );
@@ -4601,6 +4937,75 @@ var ListPage = React13.forwardRef(
4601
4937
  }
4602
4938
  );
4603
4939
  ListPage.displayName = "ListPage";
4940
+ var StatementHeader = ({ data, onEdit }) => {
4941
+ return /* @__PURE__ */ jsxs(Card, { children: [
4942
+ /* @__PURE__ */ jsxs(CardHeader, { direction: "row", children: [
4943
+ /* @__PURE__ */ jsx(CardTitle, { size: "md", children: "Statement Summary" }),
4944
+ /* @__PURE__ */ jsxs(Button, { variant: "outline", size: "sm", onClick: onEdit, children: [
4945
+ /* @__PURE__ */ jsx(Edit, { className: "h-4 w-4 mr-2" }),
4946
+ "Edit"
4947
+ ] })
4948
+ ] }),
4949
+ /* @__PURE__ */ jsx(CardContent, { children: /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6", children: [
4950
+ /* @__PURE__ */ jsx(
4951
+ InfoField,
4952
+ {
4953
+ label: "Account",
4954
+ value: data.account,
4955
+ layout: "horizontal"
4956
+ }
4957
+ ),
4958
+ /* @__PURE__ */ jsx(
4959
+ InfoField,
4960
+ {
4961
+ label: "Product ID",
4962
+ value: data.productId,
4963
+ layout: "horizontal"
4964
+ }
4965
+ ),
4966
+ /* @__PURE__ */ jsx(
4967
+ InfoField,
4968
+ {
4969
+ label: "Program ID",
4970
+ value: data.programId,
4971
+ layout: "horizontal"
4972
+ }
4973
+ ),
4974
+ /* @__PURE__ */ jsx(
4975
+ InfoField,
4976
+ {
4977
+ label: "Start Date",
4978
+ value: data.startDate,
4979
+ layout: "horizontal"
4980
+ }
4981
+ ),
4982
+ /* @__PURE__ */ jsx(
4983
+ InfoField,
4984
+ {
4985
+ label: "End Date",
4986
+ value: data.endDate,
4987
+ layout: "horizontal"
4988
+ }
4989
+ ),
4990
+ /* @__PURE__ */ jsx(
4991
+ InfoField,
4992
+ {
4993
+ label: "Starting Balance",
4994
+ value: data.startingBalance,
4995
+ layout: "horizontal"
4996
+ }
4997
+ ),
4998
+ /* @__PURE__ */ jsx(
4999
+ InfoField,
5000
+ {
5001
+ label: "Ending Balance",
5002
+ value: data.endingBalance,
5003
+ layout: "horizontal"
5004
+ }
5005
+ )
5006
+ ] }) })
5007
+ ] });
5008
+ };
4604
5009
  var ACHDetailsSection = ({ data }) => {
4605
5010
  const formatCurrency = (value) => {
4606
5011
  return new Intl.NumberFormat("en-US", {
@@ -4841,6 +5246,7 @@ function DataTable({
4841
5246
  sortBy,
4842
5247
  sortDirection,
4843
5248
  onSort,
5249
+ onRowClick,
4844
5250
  loading = false,
4845
5251
  emptyMessage = "No data available",
4846
5252
  className
@@ -4878,7 +5284,7 @@ function DataTable({
4878
5284
  "th",
4879
5285
  {
4880
5286
  className: cn(
4881
- "h-12 px-4 text-left align-middle font-medium text-muted-foreground",
5287
+ "px-3 py-2 text-left align-middle text-sm font-medium bg-muted/50",
4882
5288
  column.align === "center" && "text-center",
4883
5289
  column.align === "right" && "text-right",
4884
5290
  column.width && `w-[${column.width}]`
@@ -4888,7 +5294,7 @@ function DataTable({
4888
5294
  {
4889
5295
  variant: "ghost",
4890
5296
  size: "sm",
4891
- className: "h-auto p-0 font-medium hover:bg-transparent",
5297
+ className: "h-auto p-0 text-sm font-medium hover:bg-transparent",
4892
5298
  onClick: () => handleSort(column.key),
4893
5299
  children: /* @__PURE__ */ jsxs("span", { className: "flex items-center", children: [
4894
5300
  column.title,
@@ -4902,12 +5308,16 @@ function DataTable({
4902
5308
  /* @__PURE__ */ jsx("tbody", { children: data.length === 0 ? /* @__PURE__ */ jsx("tr", { children: /* @__PURE__ */ jsx("td", { colSpan: columns.length, className: "h-24 text-center text-muted-foreground", children: emptyMessage }) }) : data.map((row, index) => /* @__PURE__ */ jsx(
4903
5309
  "tr",
4904
5310
  {
4905
- className: "border-b transition-colors hover:bg-muted/50",
5311
+ className: cn(
5312
+ "border-b transition-colors hover:bg-muted/50",
5313
+ onRowClick && "cursor-pointer"
5314
+ ),
5315
+ onClick: () => onRowClick?.(row),
4906
5316
  children: columns.map((column) => /* @__PURE__ */ jsx(
4907
5317
  "td",
4908
5318
  {
4909
5319
  className: cn(
4910
- "p-4 align-middle",
5320
+ "px-3 py-2 align-middle text-sm",
4911
5321
  column.align === "center" && "text-center",
4912
5322
  column.align === "right" && "text-right"
4913
5323
  ),
@@ -5140,50 +5550,6 @@ var DropdownMenuSeparator = React13.forwardRef(({ className, ...props }, ref) =>
5140
5550
  }
5141
5551
  ));
5142
5552
  DropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName;
5143
- var EditableInfoField = ({
5144
- label,
5145
- value,
5146
- options,
5147
- onChange,
5148
- placeholder = "Select...",
5149
- renderValue,
5150
- className
5151
- }) => {
5152
- const [isEditing, setIsEditing] = useState(false);
5153
- const handleChange = (newValue) => {
5154
- onChange(newValue);
5155
- setIsEditing(false);
5156
- };
5157
- if (isEditing) {
5158
- return /* @__PURE__ */ jsx("div", { className, children: /* @__PURE__ */ jsx(
5159
- EnhancedSelect,
5160
- {
5161
- label,
5162
- value: value || "",
5163
- onValueChange: handleChange,
5164
- options,
5165
- placeholder
5166
- }
5167
- ) });
5168
- }
5169
- const displayValue = value ? renderValue ? renderValue(value) : value : placeholder;
5170
- return /* @__PURE__ */ jsx(
5171
- "div",
5172
- {
5173
- className: cn("cursor-pointer transition-colors hover:bg-muted/50 rounded-md -mx-2 px-2 -my-1 py-1", className),
5174
- onClick: () => setIsEditing(true),
5175
- role: "button",
5176
- tabIndex: 0,
5177
- onKeyDown: (e) => {
5178
- if (e.key === "Enter" || e.key === " ") {
5179
- e.preventDefault();
5180
- setIsEditing(true);
5181
- }
5182
- },
5183
- children: /* @__PURE__ */ jsx(InfoField, { label, value: displayValue })
5184
- }
5185
- );
5186
- };
5187
5553
  var EntityCard = React13.forwardRef(
5188
5554
  ({
5189
5555
  entity,
@@ -6305,22 +6671,10 @@ var mockAlerts = [
6305
6671
  description: "Transaction WIRE_DOMESTIC_CREDIT of $30,000.00 is flagged for velocity limit ..."
6306
6672
  }
6307
6673
  ];
6308
- var RFI_STATUS_OPTIONS = [
6309
- { value: "Completed", label: "Completed" },
6310
- { value: "Provided", label: "Provided" },
6311
- { value: "Pending", label: "Pending" }
6312
- ];
6313
- var ASSIGNEE_OPTIONS = [
6314
- { value: "John Smith", label: "John Smith" },
6315
- { value: "Sarah Johnson", label: "Sarah Johnson" },
6316
- { value: "Michael Chen", label: "Michael Chen" },
6317
- { value: "approverdev", label: "approverdev" },
6318
- { value: "Unassigned", label: "Unassigned" }
6319
- ];
6320
- var AlertDetail = () => {
6321
- const { id } = useParams();
6322
- const navigate = useNavigate();
6323
- const alert = mockAlerts.find((a) => a.id === id);
6674
+
6675
+ // src/hooks/useAlertDetail.ts
6676
+ var useAlertDetail = (id) => {
6677
+ const alert = useMemo(() => mockAlerts.find((a) => a.id === id), [id]);
6324
6678
  const [rfiStatus, setRfiStatus] = useState(alert?.rfiStatus || "");
6325
6679
  const [assignee, setAssignee] = useState(alert?.assignee || "Unassigned");
6326
6680
  const handleRfiStatusChange = (newStatus) => {
@@ -6331,6 +6685,26 @@ var AlertDetail = () => {
6331
6685
  setAssignee(newAssignee);
6332
6686
  console.log("Assignee updated to:", newAssignee);
6333
6687
  };
6688
+ return {
6689
+ alert,
6690
+ isLoading: false,
6691
+ // Set to true when implementing real data fetching
6692
+ rfiStatus,
6693
+ assignee,
6694
+ handleRfiStatusChange,
6695
+ handleAssigneeChange
6696
+ };
6697
+ };
6698
+ var AlertDetail = () => {
6699
+ const { id } = useParams();
6700
+ const navigate = useNavigate();
6701
+ const {
6702
+ alert,
6703
+ rfiStatus,
6704
+ assignee,
6705
+ handleRfiStatusChange,
6706
+ handleAssigneeChange
6707
+ } = useAlertDetail(id);
6334
6708
  if (!alert) {
6335
6709
  return /* @__PURE__ */ jsx("div", { className: "container mx-auto px-4 py-8", children: /* @__PURE__ */ jsxs("div", { className: "text-center", children: [
6336
6710
  /* @__PURE__ */ jsx("h1", { className: "text-2xl font-bold mb-2", children: "Alert Not Found" }),
@@ -6342,32 +6716,6 @@ var AlertDetail = () => {
6342
6716
  /* @__PURE__ */ jsx(Button, { onClick: () => navigate("/alerts"), children: "Back to Alerts" })
6343
6717
  ] }) });
6344
6718
  }
6345
- const getTypeBadgeVariant = (type) => {
6346
- switch (type) {
6347
- case "Ofac":
6348
- return "alert-ofac";
6349
- case "Dual Approval":
6350
- return "alert-dual";
6351
- case "Transaction Monitoring":
6352
- return "alert-monitoring";
6353
- case "Transaction Processing Error":
6354
- return "alert-error";
6355
- default:
6356
- return "outline";
6357
- }
6358
- };
6359
- const getStatusColor = (status) => {
6360
- switch (status) {
6361
- case "Unassigned":
6362
- return "text-destructive";
6363
- case "Closed":
6364
- return "text-success";
6365
- case "In Progress":
6366
- return "text-warning";
6367
- default:
6368
- return "";
6369
- }
6370
- };
6371
6719
  return /* @__PURE__ */ jsx(
6372
6720
  PageLayout,
6373
6721
  {
@@ -6391,69 +6739,16 @@ var AlertDetail = () => {
6391
6739
  onClick: () => console.log("Close alert")
6392
6740
  }
6393
6741
  ],
6394
- children: /* @__PURE__ */ jsxs("div", { className: "flex flex-col lg:flex-row gap-6", children: [
6395
- /* @__PURE__ */ jsxs("div", { className: "flex-1 grid grid-cols-1 lg:grid-cols-2 gap-6", children: [
6396
- /* @__PURE__ */ jsx(
6397
- FormCard,
6398
- {
6399
- title: "Alert Information",
6400
- headerActions: /* @__PURE__ */ jsx(Button, { variant: "ghost", size: "sm", children: /* @__PURE__ */ jsx(Edit, { className: "h-4 w-4" }) }),
6401
- children: /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
6402
- /* @__PURE__ */ jsx(InfoField, { label: "Alert ID", value: alert.id }),
6403
- /* @__PURE__ */ jsx(
6404
- InfoField,
6405
- {
6406
- label: "Type",
6407
- value: /* @__PURE__ */ jsx(Badge, { variant: getTypeBadgeVariant(alert.type), children: alert.type })
6408
- }
6409
- ),
6410
- /* @__PURE__ */ jsx(
6411
- InfoField,
6412
- {
6413
- label: "Status",
6414
- value: /* @__PURE__ */ jsx("span", { className: cn("font-medium", getStatusColor(alert.status)), children: alert.status })
6415
- }
6416
- ),
6417
- /* @__PURE__ */ jsx(InfoField, { label: "Created At", value: alert.createdAt }),
6418
- /* @__PURE__ */ jsx(
6419
- InfoField,
6420
- {
6421
- label: "Context Type",
6422
- value: /* @__PURE__ */ jsx(Badge, { variant: "outline", children: alert.contextType })
6423
- }
6424
- ),
6425
- /* @__PURE__ */ jsx(InfoField, { label: "Context ID", value: alert.contextId || "N/A" }),
6426
- /* @__PURE__ */ jsx(
6427
- EditableInfoField,
6428
- {
6429
- label: "Assignee",
6430
- value: assignee,
6431
- options: ASSIGNEE_OPTIONS,
6432
- onChange: handleAssigneeChange,
6433
- placeholder: "Unassigned"
6434
- }
6435
- ),
6436
- /* @__PURE__ */ jsx(
6437
- EditableInfoField,
6438
- {
6439
- label: "RFI Status",
6440
- value: rfiStatus,
6441
- options: RFI_STATUS_OPTIONS,
6442
- onChange: handleRfiStatusChange,
6443
- placeholder: "Select status",
6444
- renderValue: (value) => /* @__PURE__ */ jsx(Badge, { variant: "success", children: value })
6445
- }
6446
- ),
6447
- /* @__PURE__ */ jsx("div", { className: "col-span-2", children: /* @__PURE__ */ jsx(InfoField, { label: "Description", value: alert.description }) })
6448
- ] })
6449
- }
6450
- ),
6451
- /* @__PURE__ */ jsx(ContextSection, { alert }),
6452
- /* @__PURE__ */ jsx(FormCard, { title: "Notes", children: /* @__PURE__ */ jsx(AlertNotes, { alertId: alert.id, notes: alert.notes || [] }) }),
6453
- /* @__PURE__ */ jsx(FormCard, { title: "Documents", children: /* @__PURE__ */ jsx(AlertDocuments, { alertId: alert.id, documents: alert.documents || [] }) })
6454
- ] }),
6455
- /* @__PURE__ */ jsx("div", { className: "lg:w-64", children: /* @__PURE__ */ jsx(FormCard, { title: "Status Timeline", className: "h-full", children: /* @__PURE__ */ jsx(AlertTimeline, { events: alert.timeline || [] }) }) })
6456
- ] })
6742
+ children: /* @__PURE__ */ jsx(
6743
+ AlertDetailView,
6744
+ {
6745
+ alert,
6746
+ rfiStatus,
6747
+ assignee,
6748
+ onRfiStatusChange: handleRfiStatusChange,
6749
+ onAssigneeChange: handleAssigneeChange
6750
+ }
6751
+ )
6457
6752
  }
6458
6753
  );
6459
6754
  };
@@ -6512,7 +6807,7 @@ var Alerts = () => {
6512
6807
  setFilteredAlerts(mockAlerts);
6513
6808
  setCurrentPage(1);
6514
6809
  };
6515
- const getTypeBadgeVariant = (type) => {
6810
+ const getTypeBadgeVariant2 = (type) => {
6516
6811
  switch (type) {
6517
6812
  case "Ofac":
6518
6813
  return "alert-ofac";
@@ -6526,7 +6821,7 @@ var Alerts = () => {
6526
6821
  return "outline";
6527
6822
  }
6528
6823
  };
6529
- const getStatusColor = (status) => {
6824
+ const getStatusColor2 = (status) => {
6530
6825
  switch (status) {
6531
6826
  case "Unassigned":
6532
6827
  return "text-destructive";
@@ -6667,146 +6962,573 @@ var Alerts = () => {
6667
6962
  }
6668
6963
  )
6669
6964
  ] })
6670
- ] }),
6671
- /* @__PURE__ */ jsxs(SheetFooter, { className: "gap-2", children: [
6672
- /* @__PURE__ */ jsx(Button, { variant: "outline", onClick: resetFilters, children: "Reset Filters" }),
6673
- /* @__PURE__ */ jsx(Button, { onClick: applyFilters, children: "Apply Filters" })
6965
+ ] }),
6966
+ /* @__PURE__ */ jsxs(SheetFooter, { className: "gap-2", children: [
6967
+ /* @__PURE__ */ jsx(Button, { variant: "outline", onClick: resetFilters, children: "Reset Filters" }),
6968
+ /* @__PURE__ */ jsx(Button, { onClick: applyFilters, children: "Apply Filters" })
6969
+ ] })
6970
+ ] })
6971
+ ] })
6972
+ ] }) }) }),
6973
+ /* @__PURE__ */ jsx("div", { className: "flex-1 overflow-hidden", children: /* @__PURE__ */ jsx("div", { className: "container mx-auto px-4 h-full max-w-none flex flex-col", children: /* @__PURE__ */ jsxs("div", { className: "flex-1 mt-4 rounded-lg border bg-card overflow-hidden flex flex-col", children: [
6974
+ /* @__PURE__ */ jsx("div", { className: "flex-1 overflow-auto", children: /* @__PURE__ */ jsxs("table", { className: "w-full table-fixed", children: [
6975
+ /* @__PURE__ */ jsxs("colgroup", { children: [
6976
+ /* @__PURE__ */ jsx("col", { className: "w-28" }),
6977
+ /* @__PURE__ */ jsx("col", { className: "w-36" }),
6978
+ /* @__PURE__ */ jsx("col", { className: "w-52" }),
6979
+ /* @__PURE__ */ jsx("col", { className: "w-32" }),
6980
+ /* @__PURE__ */ jsx("col", { className: "w-36" }),
6981
+ /* @__PURE__ */ jsx("col", { className: "w-32" }),
6982
+ /* @__PURE__ */ jsx("col", { className: "w-auto" })
6983
+ ] }),
6984
+ /* @__PURE__ */ jsx("thead", { className: "sticky top-0 bg-card z-10 shadow-sm", children: /* @__PURE__ */ jsxs("tr", { className: "border-b", children: [
6985
+ /* @__PURE__ */ jsx("th", { className: "px-3 py-2 text-left text-xs font-medium bg-muted/50", children: "Alert ID" }),
6986
+ /* @__PURE__ */ jsx("th", { className: "px-3 py-2 text-left text-xs font-medium bg-muted/50", children: "Created At" }),
6987
+ /* @__PURE__ */ jsx("th", { className: "px-3 py-2 text-left text-xs font-medium bg-muted/50", children: "Type" }),
6988
+ /* @__PURE__ */ jsx("th", { className: "px-3 py-2 text-left text-xs font-medium bg-muted/50", children: "Status" }),
6989
+ /* @__PURE__ */ jsx("th", { className: "px-3 py-2 text-left text-xs font-medium bg-muted/50", children: "Context Type" }),
6990
+ /* @__PURE__ */ jsx("th", { className: "px-3 py-2 text-left text-xs font-medium bg-muted/50", children: "RFI Status" }),
6991
+ /* @__PURE__ */ jsx("th", { className: "px-3 py-2 text-left text-xs font-medium bg-muted/50", children: "Description" })
6992
+ ] }) }),
6993
+ /* @__PURE__ */ jsx("tbody", { children: paginatedAlerts.map((alert) => /* @__PURE__ */ jsxs(
6994
+ "tr",
6995
+ {
6996
+ className: "border-b hover:bg-muted/50 transition-colors cursor-pointer",
6997
+ onClick: () => navigate(`/alerts/${alert.id}`),
6998
+ children: [
6999
+ /* @__PURE__ */ jsx("td", { className: "px-3 py-2 text-xs", children: alert.id }),
7000
+ /* @__PURE__ */ jsx("td", { className: "px-3 py-2 text-xs", children: alert.createdAt }),
7001
+ /* @__PURE__ */ jsx("td", { className: "px-3 py-2", children: /* @__PURE__ */ jsx(Badge, { variant: getTypeBadgeVariant2(alert.type), className: "whitespace-nowrap", children: alert.type }) }),
7002
+ /* @__PURE__ */ jsx("td", { className: "px-3 py-2", children: /* @__PURE__ */ jsx("span", { className: cn("text-xs font-medium", getStatusColor2(alert.status)), children: alert.status }) }),
7003
+ /* @__PURE__ */ jsx("td", { className: "px-3 py-2", children: /* @__PURE__ */ jsx(Badge, { variant: "outline", className: "whitespace-nowrap", children: alert.contextType }) }),
7004
+ /* @__PURE__ */ jsx("td", { className: "px-3 py-2", children: alert.rfiStatus && /* @__PURE__ */ jsx(Badge, { variant: "success", className: "whitespace-nowrap", children: alert.rfiStatus }) }),
7005
+ /* @__PURE__ */ jsx("td", { className: "px-3 py-2 text-xs truncate", children: alert.description })
7006
+ ]
7007
+ },
7008
+ alert.id
7009
+ )) })
7010
+ ] }) }),
7011
+ /* @__PURE__ */ jsx("div", { className: "flex-none border-t bg-background py-3 px-4", children: /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
7012
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
7013
+ /* @__PURE__ */ jsx("span", { className: "text-sm text-muted-foreground", children: "Rows per page:" }),
7014
+ /* @__PURE__ */ jsxs(DropdownMenu, { children: [
7015
+ /* @__PURE__ */ jsx(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxs(Button, { variant: "outline", size: "sm", className: "h-8 gap-1", children: [
7016
+ rowsPerPage,
7017
+ /* @__PURE__ */ jsx(ChevronRight, { className: "h-4 w-4 rotate-90" })
7018
+ ] }) }),
7019
+ /* @__PURE__ */ jsxs(DropdownMenuContent, { align: "start", className: "bg-background z-50", children: [
7020
+ /* @__PURE__ */ jsx(DropdownMenuItem, { onClick: () => handleRowsPerPageChange(100), children: "100" }),
7021
+ /* @__PURE__ */ jsx(DropdownMenuItem, { onClick: () => handleRowsPerPageChange(200), children: "200" }),
7022
+ /* @__PURE__ */ jsx(DropdownMenuItem, { onClick: () => handleRowsPerPageChange(500), children: "500" })
7023
+ ] })
7024
+ ] })
7025
+ ] }),
7026
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-4", children: [
7027
+ /* @__PURE__ */ jsxs("span", { className: "text-sm text-muted-foreground", children: [
7028
+ "Page ",
7029
+ currentPage,
7030
+ " of ",
7031
+ totalPages
7032
+ ] }),
7033
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1", children: [
7034
+ /* @__PURE__ */ jsx(
7035
+ Button,
7036
+ {
7037
+ variant: "outline",
7038
+ size: "sm",
7039
+ className: "h-8 w-8 p-0",
7040
+ onClick: () => handlePageChange(currentPage - 1),
7041
+ disabled: currentPage === 1,
7042
+ children: /* @__PURE__ */ jsx(ChevronLeft, { className: "h-4 w-4" })
7043
+ }
7044
+ ),
7045
+ /* @__PURE__ */ jsx(
7046
+ Button,
7047
+ {
7048
+ variant: "outline",
7049
+ size: "sm",
7050
+ className: "h-8 w-8 p-0",
7051
+ onClick: () => handlePageChange(currentPage + 1),
7052
+ disabled: currentPage === totalPages,
7053
+ children: /* @__PURE__ */ jsx(ChevronRight, { className: "h-4 w-4" })
7054
+ }
7055
+ )
7056
+ ] })
7057
+ ] })
7058
+ ] }) })
7059
+ ] }) }) })
7060
+ ] });
7061
+ };
7062
+ var Alerts_default = Alerts;
7063
+
7064
+ // src/lib/mock-data/businesses-list-data.ts
7065
+ var mockBusinessesList = [
7066
+ {
7067
+ id: "8112488",
7068
+ businessName: "RAPIDZ PAY INC",
7069
+ productName: "Fiat Republic Canada Inc. FBO Rapidz Pay",
7070
+ cipStatus: "verified",
7071
+ status: "active",
7072
+ created: "2025-10-05",
7073
+ modified: "2025-10-05"
7074
+ },
7075
+ {
7076
+ id: "8111609",
7077
+ businessName: "Fern Hyper Growth Llc",
7078
+ productName: "Atomic Brokerage FBO Atomic Brokerage Clients",
7079
+ cipStatus: "verified",
7080
+ status: "active",
7081
+ created: "2025-10-04",
7082
+ modified: "2025-10-04"
7083
+ },
7084
+ {
7085
+ id: "8111026",
7086
+ businessName: "ACEROSGALVANISADOS & PREPINTADOS",
7087
+ productName: "SendFriend Inc FBO Conduit Pay Agent",
7088
+ cipStatus: "not_start",
7089
+ status: "active",
7090
+ created: "2025-10-03",
7091
+ modified: "2025-10-03"
7092
+ },
7093
+ {
7094
+ id: "8110892",
7095
+ businessName: "Tech Solutions Corp",
7096
+ productName: "Digital Finance Inc FBO Tech Solutions",
7097
+ cipStatus: "pending",
7098
+ status: "active",
7099
+ created: "2025-10-02",
7100
+ modified: "2025-10-02"
7101
+ },
7102
+ {
7103
+ id: "8110654",
7104
+ businessName: "Global Trade Partners LLC",
7105
+ productName: "Swift Transfer FBO Global Trade",
7106
+ cipStatus: "verified",
7107
+ status: "active",
7108
+ created: "2025-10-01",
7109
+ modified: "2025-10-01"
7110
+ }
7111
+ ];
7112
+ var Businesses = () => {
7113
+ const navigate = useNavigate();
7114
+ const [businesses, setBusinesses] = useState(mockBusinessesList);
7115
+ const [filteredBusinesses, setFilteredBusinesses] = useState(mockBusinessesList);
7116
+ const [sortBy, setSortBy] = useState("created");
7117
+ const [sortDirection, setSortDirection] = useState("desc");
7118
+ const [filters, setFilters] = useState({
7119
+ name: "",
7120
+ productName: "",
7121
+ status: "",
7122
+ createdDateStart: void 0,
7123
+ createdDateEnd: void 0
7124
+ });
7125
+ const handleFilterChange = (field, value) => {
7126
+ setFilters((prev) => ({ ...prev, [field]: value }));
7127
+ };
7128
+ const applyFilters = () => {
7129
+ let filtered = businesses;
7130
+ if (filters.name) {
7131
+ filtered = filtered.filter(
7132
+ (business) => business.businessName.toLowerCase().includes(filters.name.toLowerCase())
7133
+ );
7134
+ }
7135
+ if (filters.productName) {
7136
+ filtered = filtered.filter(
7137
+ (business) => business.productName.toLowerCase().includes(filters.productName.toLowerCase())
7138
+ );
7139
+ }
7140
+ if (filters.status) {
7141
+ filtered = filtered.filter((business) => business.status === filters.status);
7142
+ }
7143
+ if (filters.createdDateStart) {
7144
+ filtered = filtered.filter(
7145
+ (business) => new Date(business.created) >= filters.createdDateStart
7146
+ );
7147
+ }
7148
+ if (filters.createdDateEnd) {
7149
+ filtered = filtered.filter(
7150
+ (business) => new Date(business.created) <= filters.createdDateEnd
7151
+ );
7152
+ }
7153
+ setFilteredBusinesses(filtered);
7154
+ };
7155
+ const resetFilters = () => {
7156
+ setFilters({
7157
+ name: "",
7158
+ productName: "",
7159
+ status: "",
7160
+ createdDateStart: void 0,
7161
+ createdDateEnd: void 0
7162
+ });
7163
+ setFilteredBusinesses(businesses);
7164
+ };
7165
+ const handleSort = (key) => {
7166
+ if (sortBy === key) {
7167
+ setSortDirection(sortDirection === "asc" ? "desc" : "asc");
7168
+ } else {
7169
+ setSortBy(key);
7170
+ setSortDirection("asc");
7171
+ }
7172
+ };
7173
+ const handleRowClick = (business) => {
7174
+ navigate(`/business/${business.id}`);
7175
+ };
7176
+ const columns = [
7177
+ {
7178
+ key: "id",
7179
+ title: "Business ID",
7180
+ sortable: true
7181
+ },
7182
+ {
7183
+ key: "businessName",
7184
+ title: "Business Name",
7185
+ sortable: true
7186
+ },
7187
+ {
7188
+ key: "productName",
7189
+ title: "Product Name",
7190
+ sortable: true,
7191
+ render: (value) => /* @__PURE__ */ jsx("span", { className: "text-primary hover:underline cursor-pointer", children: value })
7192
+ },
7193
+ {
7194
+ key: "cipStatus",
7195
+ title: "CIP status",
7196
+ sortable: true,
7197
+ render: (value) => {
7198
+ const status = value;
7199
+ const variant = status === "verified" ? "success" : status === "pending" ? "warning" : "default";
7200
+ const label = status === "verified" ? "Verified" : status === "pending" ? "Pending" : "Not Start";
7201
+ return /* @__PURE__ */ jsx(Badge, { variant, children: label });
7202
+ }
7203
+ },
7204
+ {
7205
+ key: "status",
7206
+ title: "Status",
7207
+ sortable: true,
7208
+ render: (value) => {
7209
+ const status = value;
7210
+ const variant = status === "active" ? "success" : "default";
7211
+ const label = status.charAt(0).toUpperCase() + status.slice(1);
7212
+ return /* @__PURE__ */ jsx(Badge, { variant, children: label });
7213
+ }
7214
+ },
7215
+ {
7216
+ key: "created",
7217
+ title: "Created",
7218
+ sortable: true
7219
+ },
7220
+ {
7221
+ key: "modified",
7222
+ title: "Modified",
7223
+ sortable: true
7224
+ }
7225
+ ];
7226
+ const sortedBusinesses = [...filteredBusinesses].sort((a, b) => {
7227
+ const aValue = a[sortBy];
7228
+ const bValue = b[sortBy];
7229
+ if (aValue < bValue) return sortDirection === "asc" ? -1 : 1;
7230
+ if (aValue > bValue) return sortDirection === "asc" ? 1 : -1;
7231
+ return 0;
7232
+ });
7233
+ return /* @__PURE__ */ jsxs("div", { className: "flex flex-col h-screen bg-gradient-subtle", children: [
7234
+ /* @__PURE__ */ jsx("div", { className: "flex-none border-b bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/60", children: /* @__PURE__ */ jsx("div", { className: "container mx-auto px-4 py-4 max-w-none", children: /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
7235
+ /* @__PURE__ */ jsxs("div", { children: [
7236
+ /* @__PURE__ */ jsx("h1", { className: "text-3xl font-bold text-foreground", children: "Businesses" }),
7237
+ /* @__PURE__ */ jsx("p", { className: "text-muted-foreground mt-1", children: "Manage business entities and their configurations" })
7238
+ ] }),
7239
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
7240
+ /* @__PURE__ */ jsxs(Sheet, { children: [
7241
+ /* @__PURE__ */ jsx(SheetTrigger, { asChild: true, children: /* @__PURE__ */ jsxs(Button, { variant: "outline", className: "gap-2", children: [
7242
+ /* @__PURE__ */ jsx(Filter, { className: "h-4 w-4" }),
7243
+ "Filters"
7244
+ ] }) }),
7245
+ /* @__PURE__ */ jsxs(SheetContent, { side: "right", className: "w-full sm:max-w-xl overflow-y-auto", children: [
7246
+ /* @__PURE__ */ jsx(SheetHeader, { children: /* @__PURE__ */ jsx(SheetTitle, { children: "Business Filters" }) }),
7247
+ /* @__PURE__ */ jsxs("div", { className: "space-y-6 py-6", children: [
7248
+ /* @__PURE__ */ jsx(
7249
+ EnhancedInput,
7250
+ {
7251
+ label: "Name",
7252
+ value: filters.name,
7253
+ onChange: (e) => handleFilterChange("name", e.target.value),
7254
+ placeholder: "Enter business name"
7255
+ }
7256
+ ),
7257
+ /* @__PURE__ */ jsx(
7258
+ EnhancedInput,
7259
+ {
7260
+ label: "Product Name",
7261
+ value: filters.productName,
7262
+ onChange: (e) => handleFilterChange("productName", e.target.value),
7263
+ placeholder: "Enter product name"
7264
+ }
7265
+ ),
7266
+ /* @__PURE__ */ jsx(
7267
+ EnhancedSelect,
7268
+ {
7269
+ label: "Status",
7270
+ value: filters.status,
7271
+ onValueChange: (value) => handleFilterChange("status", value),
7272
+ placeholder: "Select status",
7273
+ options: [
7274
+ { value: "active", label: "Active" },
7275
+ { value: "inactive", label: "Inactive" },
7276
+ { value: "suspended", label: "Suspended" }
7277
+ ]
7278
+ }
7279
+ ),
7280
+ /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
7281
+ /* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
7282
+ /* @__PURE__ */ jsx("label", { className: "text-sm font-medium", children: "Created Date Start" }),
7283
+ /* @__PURE__ */ jsxs(Popover, { children: [
7284
+ /* @__PURE__ */ jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxs(
7285
+ Button,
7286
+ {
7287
+ variant: "outline",
7288
+ className: cn(
7289
+ "w-full justify-start text-left font-normal",
7290
+ !filters.createdDateStart && "text-muted-foreground"
7291
+ ),
7292
+ children: [
7293
+ /* @__PURE__ */ jsx(Calendar$1, { className: "mr-2 h-4 w-4" }),
7294
+ filters.createdDateStart ? format(filters.createdDateStart, "MM/dd/yyyy") : /* @__PURE__ */ jsx("span", { children: "MM/DD/YYYY" })
7295
+ ]
7296
+ }
7297
+ ) }),
7298
+ /* @__PURE__ */ jsx(PopoverContent, { className: "w-auto p-0 bg-background z-50", align: "start", children: /* @__PURE__ */ jsx(
7299
+ Calendar,
7300
+ {
7301
+ mode: "single",
7302
+ selected: filters.createdDateStart,
7303
+ onSelect: (date) => handleFilterChange("createdDateStart", date),
7304
+ initialFocus: true,
7305
+ className: "pointer-events-auto"
7306
+ }
7307
+ ) })
7308
+ ] })
7309
+ ] }),
7310
+ /* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
7311
+ /* @__PURE__ */ jsx("label", { className: "text-sm font-medium", children: "Created Date End" }),
7312
+ /* @__PURE__ */ jsxs(Popover, { children: [
7313
+ /* @__PURE__ */ jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxs(
7314
+ Button,
7315
+ {
7316
+ variant: "outline",
7317
+ className: cn(
7318
+ "w-full justify-start text-left font-normal",
7319
+ !filters.createdDateEnd && "text-muted-foreground"
7320
+ ),
7321
+ children: [
7322
+ /* @__PURE__ */ jsx(Calendar$1, { className: "mr-2 h-4 w-4" }),
7323
+ filters.createdDateEnd ? format(filters.createdDateEnd, "MM/dd/yyyy") : /* @__PURE__ */ jsx("span", { children: "MM/DD/YYYY" })
7324
+ ]
7325
+ }
7326
+ ) }),
7327
+ /* @__PURE__ */ jsx(PopoverContent, { className: "w-auto p-0 bg-background z-50", align: "start", children: /* @__PURE__ */ jsx(
7328
+ Calendar,
7329
+ {
7330
+ mode: "single",
7331
+ selected: filters.createdDateEnd,
7332
+ onSelect: (date) => handleFilterChange("createdDateEnd", date),
7333
+ initialFocus: true,
7334
+ className: "pointer-events-auto"
7335
+ }
7336
+ ) })
7337
+ ] })
7338
+ ] })
7339
+ ] })
7340
+ ] }),
7341
+ /* @__PURE__ */ jsxs(SheetFooter, { className: "gap-2", children: [
7342
+ /* @__PURE__ */ jsx(Button, { variant: "outline", onClick: resetFilters, children: "Reset Filters" }),
7343
+ /* @__PURE__ */ jsx(Button, { onClick: applyFilters, children: "Apply Filters" })
7344
+ ] })
6674
7345
  ] })
6675
- ] })
7346
+ ] }),
7347
+ /* @__PURE__ */ jsx(Button, { onClick: () => navigate("/business/create"), children: "Create Business" })
6676
7348
  ] })
6677
7349
  ] }) }) }),
6678
- /* @__PURE__ */ jsx("div", { className: "flex-1 overflow-hidden", children: /* @__PURE__ */ jsx("div", { className: "container mx-auto px-4 h-full max-w-none flex flex-col", children: /* @__PURE__ */ jsxs("div", { className: "flex-1 mt-4 rounded-lg border bg-card overflow-hidden flex flex-col", children: [
6679
- /* @__PURE__ */ jsx("div", { className: "flex-1 overflow-auto", children: /* @__PURE__ */ jsxs("table", { className: "w-full table-fixed", children: [
6680
- /* @__PURE__ */ jsxs("colgroup", { children: [
6681
- /* @__PURE__ */ jsx("col", { className: "w-28" }),
6682
- /* @__PURE__ */ jsx("col", { className: "w-36" }),
6683
- /* @__PURE__ */ jsx("col", { className: "w-52" }),
6684
- /* @__PURE__ */ jsx("col", { className: "w-32" }),
6685
- /* @__PURE__ */ jsx("col", { className: "w-36" }),
6686
- /* @__PURE__ */ jsx("col", { className: "w-32" }),
6687
- /* @__PURE__ */ jsx("col", { className: "w-auto" })
6688
- ] }),
6689
- /* @__PURE__ */ jsx("thead", { className: "sticky top-0 bg-card z-10 shadow-sm", children: /* @__PURE__ */ jsxs("tr", { className: "border-b", children: [
6690
- /* @__PURE__ */ jsx("th", { className: "px-3 py-2 text-left text-xs font-medium bg-muted/50", children: "Alert ID" }),
6691
- /* @__PURE__ */ jsx("th", { className: "px-3 py-2 text-left text-xs font-medium bg-muted/50", children: "Created At" }),
6692
- /* @__PURE__ */ jsx("th", { className: "px-3 py-2 text-left text-xs font-medium bg-muted/50", children: "Type" }),
6693
- /* @__PURE__ */ jsx("th", { className: "px-3 py-2 text-left text-xs font-medium bg-muted/50", children: "Status" }),
6694
- /* @__PURE__ */ jsx("th", { className: "px-3 py-2 text-left text-xs font-medium bg-muted/50", children: "Context Type" }),
6695
- /* @__PURE__ */ jsx("th", { className: "px-3 py-2 text-left text-xs font-medium bg-muted/50", children: "RFI Status" }),
6696
- /* @__PURE__ */ jsx("th", { className: "px-3 py-2 text-left text-xs font-medium bg-muted/50", children: "Description" })
6697
- ] }) }),
6698
- /* @__PURE__ */ jsx("tbody", { children: paginatedAlerts.map((alert) => /* @__PURE__ */ jsxs(
6699
- "tr",
7350
+ /* @__PURE__ */ jsx("div", { className: "flex-1 overflow-hidden", children: /* @__PURE__ */ jsx("div", { className: "container mx-auto px-4 h-full max-w-none flex flex-col", children: /* @__PURE__ */ jsx("div", { className: "flex-1 mt-4 overflow-auto", children: /* @__PURE__ */ jsx(
7351
+ DataTable,
7352
+ {
7353
+ columns,
7354
+ data: sortedBusinesses,
7355
+ sortBy,
7356
+ sortDirection,
7357
+ onSort: handleSort,
7358
+ onRowClick: handleRowClick
7359
+ }
7360
+ ) }) }) })
7361
+ ] });
7362
+ };
7363
+ var Businesses_default = Businesses;
7364
+ var businessAccounts = [
7365
+ {
7366
+ id: "acc-001",
7367
+ name: "Primary Operating Account",
7368
+ number: "****7890",
7369
+ type: "checking",
7370
+ status: "active",
7371
+ balance: "$125,450.00",
7372
+ currency: "USD",
7373
+ institution: "Chase Bank",
7374
+ routingNumber: "021000021",
7375
+ country: "US"
7376
+ },
7377
+ {
7378
+ id: "acc-002",
7379
+ name: "Business Savings",
7380
+ number: "****4567",
7381
+ type: "savings",
7382
+ status: "active",
7383
+ balance: "$45,230.00",
7384
+ currency: "USD",
7385
+ institution: "Chase Bank",
7386
+ routingNumber: "021000021",
7387
+ country: "US"
7388
+ },
7389
+ {
7390
+ id: "acc-003",
7391
+ name: "Payroll Account",
7392
+ number: "****1234",
7393
+ type: "checking",
7394
+ status: "active",
7395
+ balance: "$78,900.00",
7396
+ currency: "USD",
7397
+ institution: "Wells Fargo",
7398
+ routingNumber: "121000248",
7399
+ country: "US"
7400
+ }
7401
+ ];
7402
+ var businessCounterparties = [
7403
+ {
7404
+ id: "cp-001",
7405
+ name: "Tech Solutions Inc",
7406
+ type: "BUSINESS",
7407
+ status: "active",
7408
+ description: "Technology vendor and service provider",
7409
+ lastTransaction: "2024-01-15"
7410
+ },
7411
+ {
7412
+ id: "cp-002",
7413
+ name: "Global Logistics LLC",
7414
+ type: "BUSINESS",
7415
+ status: "active",
7416
+ description: "Shipping and logistics partner",
7417
+ lastTransaction: "2024-01-10"
7418
+ },
7419
+ {
7420
+ id: "cp-003",
7421
+ name: "Marketing Pros Agency",
7422
+ type: "BUSINESS",
7423
+ status: "active",
7424
+ description: "Marketing and advertising services",
7425
+ lastTransaction: "2024-01-08"
7426
+ },
7427
+ {
7428
+ id: "cp-004",
7429
+ name: "John Smith Consulting",
7430
+ type: "INDIVIDUAL",
7431
+ status: "active",
7432
+ description: "Independent business consultant",
7433
+ lastTransaction: "2023-12-20"
7434
+ }
7435
+ ];
7436
+ var Business = () => {
7437
+ const accountColumns = [
7438
+ {
7439
+ key: "number",
7440
+ title: "Account Number",
7441
+ sortable: true
7442
+ },
7443
+ {
7444
+ key: "name",
7445
+ title: "Account Name",
7446
+ sortable: true
7447
+ },
7448
+ {
7449
+ key: "balance",
7450
+ title: "Available Balance",
7451
+ sortable: true,
7452
+ align: "right"
7453
+ },
7454
+ {
7455
+ key: "status",
7456
+ title: "Status",
7457
+ render: (value) => /* @__PURE__ */ jsx(StatusBadge, { status: value })
7458
+ }
7459
+ ];
7460
+ return /* @__PURE__ */ jsxs("div", { className: "container mx-auto p-6 space-y-6", children: [
7461
+ /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx("h1", { className: "text-3xl font-bold tracking-tight", children: "Business Management" }) }),
7462
+ /* @__PURE__ */ jsxs(Tabs, { defaultValue: "profile", className: "space-y-6", children: [
7463
+ /* @__PURE__ */ jsxs(TabsList, { className: "inline-flex gap-8 h-auto bg-transparent border-b border-border w-full p-0 rounded-none justify-start", children: [
7464
+ /* @__PURE__ */ jsx(
7465
+ TabsTrigger,
6700
7466
  {
6701
- className: "border-b hover:bg-muted/50 transition-colors cursor-pointer",
6702
- onClick: () => navigate(`/alerts/${alert.id}`),
6703
- children: [
6704
- /* @__PURE__ */ jsx("td", { className: "px-3 py-2 text-xs", children: alert.id }),
6705
- /* @__PURE__ */ jsx("td", { className: "px-3 py-2 text-xs", children: alert.createdAt }),
6706
- /* @__PURE__ */ jsx("td", { className: "px-3 py-2", children: /* @__PURE__ */ jsx(Badge, { variant: getTypeBadgeVariant(alert.type), className: "whitespace-nowrap", children: alert.type }) }),
6707
- /* @__PURE__ */ jsx("td", { className: "px-3 py-2", children: /* @__PURE__ */ jsx("span", { className: cn("text-xs font-medium", getStatusColor(alert.status)), children: alert.status }) }),
6708
- /* @__PURE__ */ jsx("td", { className: "px-3 py-2", children: /* @__PURE__ */ jsx(Badge, { variant: "outline", className: "whitespace-nowrap", children: alert.contextType }) }),
6709
- /* @__PURE__ */ jsx("td", { className: "px-3 py-2", children: alert.rfiStatus && /* @__PURE__ */ jsx(Badge, { variant: "success", className: "whitespace-nowrap", children: alert.rfiStatus }) }),
6710
- /* @__PURE__ */ jsx("td", { className: "px-3 py-2 text-xs truncate", children: alert.description })
6711
- ]
6712
- },
6713
- alert.id
6714
- )) })
6715
- ] }) }),
6716
- /* @__PURE__ */ jsx("div", { className: "flex-none border-t bg-background py-3 px-4", children: /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
6717
- /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
6718
- /* @__PURE__ */ jsx("span", { className: "text-sm text-muted-foreground", children: "Rows per page:" }),
6719
- /* @__PURE__ */ jsxs(DropdownMenu, { children: [
6720
- /* @__PURE__ */ jsx(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxs(Button, { variant: "outline", size: "sm", className: "h-8 gap-1", children: [
6721
- rowsPerPage,
6722
- /* @__PURE__ */ jsx(ChevronRight, { className: "h-4 w-4 rotate-90" })
6723
- ] }) }),
6724
- /* @__PURE__ */ jsxs(DropdownMenuContent, { align: "start", className: "bg-background z-50", children: [
6725
- /* @__PURE__ */ jsx(DropdownMenuItem, { onClick: () => handleRowsPerPageChange(100), children: "100" }),
6726
- /* @__PURE__ */ jsx(DropdownMenuItem, { onClick: () => handleRowsPerPageChange(200), children: "200" }),
6727
- /* @__PURE__ */ jsx(DropdownMenuItem, { onClick: () => handleRowsPerPageChange(500), children: "500" })
6728
- ] })
7467
+ value: "profile",
7468
+ className: "rounded-none border-b-2 border-transparent data-[state=active]:border-primary data-[state=active]:bg-transparent data-[state=active]:shadow-none pb-3",
7469
+ children: "Profile"
7470
+ }
7471
+ ),
7472
+ /* @__PURE__ */ jsx(
7473
+ TabsTrigger,
7474
+ {
7475
+ value: "kyc",
7476
+ className: "rounded-none border-b-2 border-transparent data-[state=active]:border-primary data-[state=active]:bg-transparent data-[state=active]:shadow-none pb-3",
7477
+ children: "KYC"
7478
+ }
7479
+ ),
7480
+ /* @__PURE__ */ jsx(
7481
+ TabsTrigger,
7482
+ {
7483
+ value: "counterparty",
7484
+ className: "rounded-none border-b-2 border-transparent data-[state=active]:border-primary data-[state=active]:bg-transparent data-[state=active]:shadow-none pb-3",
7485
+ children: "Counterparty"
7486
+ }
7487
+ )
7488
+ ] }),
7489
+ /* @__PURE__ */ jsx(TabsContent, { value: "profile", className: "space-y-0", children: /* @__PURE__ */ jsxs("div", { className: "flex flex-col lg:flex-row items-start gap-6", children: [
7490
+ /* @__PURE__ */ jsxs("div", { className: "flex-1 space-y-6", children: [
7491
+ /* @__PURE__ */ jsx(BusinessProfileCard, { isEditing: false, onToggleEdit: () => {
7492
+ } }),
7493
+ /* @__PURE__ */ jsxs(Card, { children: [
7494
+ /* @__PURE__ */ jsxs(CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-4", children: [
7495
+ /* @__PURE__ */ jsx(CardTitle, { children: "Accounts" }),
7496
+ /* @__PURE__ */ jsx(Button, { size: "sm", children: "+ New Account" })
7497
+ ] }),
7498
+ /* @__PURE__ */ jsx(CardContent, { children: /* @__PURE__ */ jsx(
7499
+ DataTable,
7500
+ {
7501
+ columns: accountColumns,
7502
+ data: businessAccounts,
7503
+ emptyMessage: "No accounts found"
7504
+ }
7505
+ ) })
6729
7506
  ] })
6730
7507
  ] }),
6731
- /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-4", children: [
6732
- /* @__PURE__ */ jsxs("span", { className: "text-sm text-muted-foreground", children: [
6733
- "Page ",
6734
- currentPage,
6735
- " of ",
6736
- totalPages
7508
+ /* @__PURE__ */ jsx("div", { className: "lg:w-64", children: /* @__PURE__ */ jsx(BusinessStatusCard, { isEditing: false, onToggleEdit: () => {
7509
+ } }) })
7510
+ ] }) }),
7511
+ /* @__PURE__ */ jsx(TabsContent, { value: "kyc", className: "space-y-0", children: /* @__PURE__ */ jsx("div", { className: "p-8 text-center text-muted-foreground", children: "KYC content coming soon" }) }),
7512
+ /* @__PURE__ */ jsx(TabsContent, { value: "counterparty", className: "space-y-0", children: /* @__PURE__ */ jsx("div", { className: "grid grid-cols-1 lg:grid-cols-2 xl:grid-cols-3 gap-6", children: businessCounterparties.map((counterparty) => /* @__PURE__ */ jsxs(Card, { children: [
7513
+ /* @__PURE__ */ jsxs(CardHeader, { children: [
7514
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
7515
+ /* @__PURE__ */ jsx(CardTitle, { className: "text-lg", children: counterparty.name }),
7516
+ /* @__PURE__ */ jsx(CounterpartyTypeBadge, { type: counterparty.type })
6737
7517
  ] }),
6738
- /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1", children: [
6739
- /* @__PURE__ */ jsx(
6740
- Button,
6741
- {
6742
- variant: "outline",
6743
- size: "sm",
6744
- className: "h-8 w-8 p-0",
6745
- onClick: () => handlePageChange(currentPage - 1),
6746
- disabled: currentPage === 1,
6747
- children: /* @__PURE__ */ jsx(ChevronLeft, { className: "h-4 w-4" })
6748
- }
6749
- ),
6750
- /* @__PURE__ */ jsx(
6751
- Button,
6752
- {
6753
- variant: "outline",
6754
- size: "sm",
6755
- className: "h-8 w-8 p-0",
6756
- onClick: () => handlePageChange(currentPage + 1),
6757
- disabled: currentPage === totalPages,
6758
- children: /* @__PURE__ */ jsx(ChevronRight, { className: "h-4 w-4" })
6759
- }
6760
- )
7518
+ /* @__PURE__ */ jsx("div", { className: "flex items-center gap-2 mt-2", children: /* @__PURE__ */ jsx(Badge, { variant: counterparty.status === "active" ? "default" : "secondary", children: counterparty.status }) })
7519
+ ] }),
7520
+ /* @__PURE__ */ jsxs(CardContent, { className: "space-y-3", children: [
7521
+ /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: counterparty.description }),
7522
+ /* @__PURE__ */ jsxs("div", { className: "flex justify-between items-center text-sm", children: [
7523
+ /* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: "Last Transaction" }),
7524
+ /* @__PURE__ */ jsx("span", { className: "font-medium", children: counterparty.lastTransaction })
6761
7525
  ] })
6762
7526
  ] })
6763
- ] }) })
6764
- ] }) }) })
7527
+ ] }, counterparty.id)) }) })
7528
+ ] })
6765
7529
  ] });
6766
7530
  };
6767
- var Alerts_default = Alerts;
6768
- var Business = () => {
6769
- return /* @__PURE__ */ jsx(
6770
- DetailPageLayout,
6771
- {
6772
- title: "Business Management",
6773
- description: "Manage business entities and their configurations",
6774
- cards: [
6775
- {
6776
- key: "profile",
6777
- component: BusinessProfileCard,
6778
- expandOnEdit: true
6779
- },
6780
- {
6781
- key: "status",
6782
- component: BusinessStatusCard,
6783
- expandOnEdit: true
6784
- },
6785
- {
6786
- key: "contact",
6787
- component: ContactInfoCard,
6788
- expandOnEdit: true
6789
- },
6790
- {
6791
- key: "banking",
6792
- component: BankingDetailsCard,
6793
- expandOnEdit: true
6794
- }
6795
- ],
6796
- actions: [
6797
- {
6798
- label: "Export Data",
6799
- variant: "outline"
6800
- },
6801
- {
6802
- label: "Edit Business",
6803
- className: "bg-gradient-primary hover:opacity-90"
6804
- }
6805
- ]
6806
- }
6807
- );
6808
- };
6809
- var Business_default = Business;
7531
+ var BusinessDetail_default = Business;
6810
7532
  var CreateBusiness = () => {
6811
7533
  const [businessType, setBusinessType] = useState("");
6812
7534
  return /* @__PURE__ */ jsx(
@@ -7178,6 +7900,258 @@ var NotFound = () => {
7178
7900
  };
7179
7901
  var NotFound_default = NotFound;
7180
7902
 
7903
+ // src/lib/mock-data/statement-data.ts
7904
+ var mockStatementHeader = {
7905
+ account: "1234567890",
7906
+ productId: "PROD-001",
7907
+ programId: "PROG-001",
7908
+ startDate: "01/01/2024 00:00:00",
7909
+ endDate: "01/31/2024 23:59:59",
7910
+ startingBalance: "$125,450.00",
7911
+ endingBalance: "$158,320.50"
7912
+ };
7913
+ var mockStatementTransactions = [
7914
+ { transactionType: "ACH Credit", direction: "CREDIT", amount: 45e3, count: 12 },
7915
+ { transactionType: "ACH Debit", direction: "DEBIT", amount: 23500, count: 8 },
7916
+ { transactionType: "Wire Transfer In", direction: "CREDIT", amount: 15e3, count: 3 },
7917
+ { transactionType: "Wire Transfer Out", direction: "DEBIT", amount: 8200, count: 2 },
7918
+ { transactionType: "Card Purchase", direction: "DEBIT", amount: 5430.5, count: 45 },
7919
+ { transactionType: "Direct Deposit", direction: "CREDIT", amount: 12500, count: 5 },
7920
+ { transactionType: "ATM Withdrawal", direction: "DEBIT", amount: 3200, count: 16 },
7921
+ { transactionType: "Check Deposit", direction: "CREDIT", amount: 8900, count: 4 },
7922
+ { transactionType: "Bill Payment", direction: "DEBIT", amount: 6780, count: 18 },
7923
+ { transactionType: "Transfer In", direction: "CREDIT", amount: 5200, count: 7 },
7924
+ { transactionType: "Transfer Out", direction: "DEBIT", amount: 4350, count: 6 },
7925
+ { transactionType: "Fee", direction: "DEBIT", amount: 125, count: 3 },
7926
+ { transactionType: "Interest", direction: "CREDIT", amount: 85.5, count: 1 },
7927
+ { transactionType: "Refund", direction: "CREDIT", amount: 450, count: 2 }
7928
+ ];
7929
+ var mockPrograms = [
7930
+ { value: "PROG-001", label: "Consumer Banking Program" },
7931
+ { value: "PROG-002", label: "Business Banking Program" },
7932
+ { value: "PROG-003", label: "Premium Rewards Program" }
7933
+ ];
7934
+ var mockProducts = [
7935
+ { value: "PROD-001", label: "Checking Account" },
7936
+ { value: "PROD-002", label: "Savings Account" },
7937
+ { value: "PROD-003", label: "Money Market Account" },
7938
+ { value: "PROD-004", label: "Business Checking" }
7939
+ ];
7940
+ var statementTypes = [
7941
+ { value: "root", label: "Root" },
7942
+ { value: "program", label: "Program" },
7943
+ { value: "product", label: "Product" },
7944
+ { value: "account", label: "Account" }
7945
+ ];
7946
+ function Statement() {
7947
+ const [statementType, setStatementType] = useState("");
7948
+ const [selectedProgram, setSelectedProgram] = useState("");
7949
+ const [selectedProduct, setSelectedProduct] = useState("");
7950
+ const [accountNumber, setAccountNumber] = useState("");
7951
+ const [startDate, setStartDate] = useState();
7952
+ const [endDate, setEndDate] = useState();
7953
+ const [statementGenerated, setStatementGenerated] = useState(false);
7954
+ const handleStatementTypeChange = (value) => {
7955
+ setStatementType(value);
7956
+ setSelectedProgram("");
7957
+ setSelectedProduct("");
7958
+ setAccountNumber("");
7959
+ };
7960
+ const handleGenerateStatement = () => {
7961
+ if (!statementType || !startDate || !endDate) return;
7962
+ if (statementType === "program" && !selectedProgram) return;
7963
+ if (statementType === "product" && !selectedProduct) return;
7964
+ if (statementType === "account" && !accountNumber) return;
7965
+ setStatementGenerated(true);
7966
+ };
7967
+ const isGenerateDisabled = () => {
7968
+ if (!statementType || !startDate || !endDate) return true;
7969
+ if (statementType === "program" && !selectedProgram) return true;
7970
+ if (statementType === "product" && !selectedProduct) return true;
7971
+ if (statementType === "account" && !accountNumber) return true;
7972
+ return false;
7973
+ };
7974
+ const columns = [
7975
+ {
7976
+ key: "transactionType",
7977
+ title: "Transaction Type",
7978
+ sortable: true,
7979
+ align: "left"
7980
+ },
7981
+ {
7982
+ key: "direction",
7983
+ title: "Direction",
7984
+ sortable: true,
7985
+ align: "left",
7986
+ render: (value) => /* @__PURE__ */ jsx(Badge, { variant: value === "CREDIT" ? "success" : "secondary", children: value })
7987
+ },
7988
+ {
7989
+ key: "amount",
7990
+ title: "Amount",
7991
+ sortable: true,
7992
+ align: "right",
7993
+ render: (value) => `$${value.toLocaleString("en-US", { minimumFractionDigits: 2, maximumFractionDigits: 2 })}`
7994
+ },
7995
+ {
7996
+ key: "count",
7997
+ title: "Count",
7998
+ sortable: true,
7999
+ align: "right"
8000
+ }
8001
+ ];
8002
+ const handleDownloadCSV = () => {
8003
+ console.log("Downloading CSV...");
8004
+ };
8005
+ const handlePrintPDF = () => {
8006
+ console.log("Printing PDF...");
8007
+ };
8008
+ const handleEdit = () => {
8009
+ setStatementGenerated(false);
8010
+ };
8011
+ return /* @__PURE__ */ jsxs("div", { className: "container mx-auto p-6 space-y-6", children: [
8012
+ /* @__PURE__ */ jsxs("div", { children: [
8013
+ /* @__PURE__ */ jsx("h1", { className: "text-3xl font-bold tracking-tight", children: "Statement" }),
8014
+ /* @__PURE__ */ jsx("p", { className: "text-muted-foreground mt-1", children: "Generate and view statement reports" })
8015
+ ] }),
8016
+ !statementGenerated && /* @__PURE__ */ jsxs(Card, { children: [
8017
+ /* @__PURE__ */ jsx(CardHeader, { children: /* @__PURE__ */ jsx(CardTitle, { size: "md", children: "Statement Parameters" }) }),
8018
+ /* @__PURE__ */ jsxs(CardContent, { className: "space-y-4", children: [
8019
+ /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4", children: [
8020
+ /* @__PURE__ */ jsx(
8021
+ EnhancedSelect,
8022
+ {
8023
+ label: "Statement Type",
8024
+ placeholder: "Select type",
8025
+ options: statementTypes,
8026
+ value: statementType,
8027
+ onValueChange: handleStatementTypeChange
8028
+ }
8029
+ ),
8030
+ statementType === "program" && /* @__PURE__ */ jsx(
8031
+ EnhancedSelect,
8032
+ {
8033
+ label: "Program Name",
8034
+ placeholder: "Select program",
8035
+ options: mockPrograms,
8036
+ value: selectedProgram,
8037
+ onValueChange: setSelectedProgram
8038
+ }
8039
+ ),
8040
+ statementType === "product" && /* @__PURE__ */ jsx(
8041
+ EnhancedSelect,
8042
+ {
8043
+ label: "Product Name",
8044
+ placeholder: "Select product",
8045
+ options: mockProducts,
8046
+ value: selectedProduct,
8047
+ onValueChange: setSelectedProduct
8048
+ }
8049
+ ),
8050
+ statementType === "account" && /* @__PURE__ */ jsx(
8051
+ EnhancedInput,
8052
+ {
8053
+ label: "Account Number",
8054
+ placeholder: "Enter account number",
8055
+ value: accountNumber,
8056
+ onChange: (e) => setAccountNumber(e.target.value)
8057
+ }
8058
+ ),
8059
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-2", children: [
8060
+ /* @__PURE__ */ jsx("label", { className: "text-sm font-medium", children: "Start Date" }),
8061
+ /* @__PURE__ */ jsxs(Popover, { children: [
8062
+ /* @__PURE__ */ jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxs(
8063
+ Button,
8064
+ {
8065
+ variant: "outline",
8066
+ className: cn(
8067
+ "justify-start text-left font-normal",
8068
+ !startDate && "text-muted-foreground"
8069
+ ),
8070
+ children: [
8071
+ /* @__PURE__ */ jsx(CalendarIcon, { className: "mr-2 h-4 w-4" }),
8072
+ startDate ? format(startDate, "MM/dd/yyyy") : "Select date"
8073
+ ]
8074
+ }
8075
+ ) }),
8076
+ /* @__PURE__ */ jsx(PopoverContent, { className: "w-auto p-0", align: "start", children: /* @__PURE__ */ jsx(
8077
+ Calendar,
8078
+ {
8079
+ mode: "single",
8080
+ selected: startDate,
8081
+ onSelect: setStartDate,
8082
+ initialFocus: true
8083
+ }
8084
+ ) })
8085
+ ] })
8086
+ ] }),
8087
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-2", children: [
8088
+ /* @__PURE__ */ jsx("label", { className: "text-sm font-medium", children: "End Date" }),
8089
+ /* @__PURE__ */ jsxs(Popover, { children: [
8090
+ /* @__PURE__ */ jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxs(
8091
+ Button,
8092
+ {
8093
+ variant: "outline",
8094
+ className: cn(
8095
+ "justify-start text-left font-normal",
8096
+ !endDate && "text-muted-foreground"
8097
+ ),
8098
+ children: [
8099
+ /* @__PURE__ */ jsx(CalendarIcon, { className: "mr-2 h-4 w-4" }),
8100
+ endDate ? format(endDate, "MM/dd/yyyy") : "Select date"
8101
+ ]
8102
+ }
8103
+ ) }),
8104
+ /* @__PURE__ */ jsx(PopoverContent, { className: "w-auto p-0", align: "start", children: /* @__PURE__ */ jsx(
8105
+ Calendar,
8106
+ {
8107
+ mode: "single",
8108
+ selected: endDate,
8109
+ onSelect: setEndDate,
8110
+ initialFocus: true
8111
+ }
8112
+ ) })
8113
+ ] })
8114
+ ] })
8115
+ ] }),
8116
+ /* @__PURE__ */ jsx("div", { className: "flex justify-end", children: /* @__PURE__ */ jsx(
8117
+ Button,
8118
+ {
8119
+ onClick: handleGenerateStatement,
8120
+ disabled: isGenerateDisabled(),
8121
+ children: "Generate Statement"
8122
+ }
8123
+ ) })
8124
+ ] })
8125
+ ] }),
8126
+ statementGenerated && /* @__PURE__ */ jsxs(Fragment, { children: [
8127
+ /* @__PURE__ */ jsx(StatementHeader, { data: mockStatementHeader, onEdit: handleEdit }),
8128
+ /* @__PURE__ */ jsxs(Card, { children: [
8129
+ /* @__PURE__ */ jsxs(CardHeader, { direction: "row", children: [
8130
+ /* @__PURE__ */ jsx(CardTitle, { size: "md", children: "Transaction Summary" }),
8131
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
8132
+ /* @__PURE__ */ jsxs(Button, { variant: "outline", onClick: handleDownloadCSV, children: [
8133
+ /* @__PURE__ */ jsx(Download, { className: "h-4 w-4 mr-2" }),
8134
+ "Download CSV"
8135
+ ] }),
8136
+ /* @__PURE__ */ jsxs(Button, { variant: "outline", onClick: handlePrintPDF, children: [
8137
+ /* @__PURE__ */ jsx(FileText, { className: "h-4 w-4 mr-2" }),
8138
+ "Print PDF"
8139
+ ] })
8140
+ ] })
8141
+ ] }),
8142
+ /* @__PURE__ */ jsx(CardContent, { children: /* @__PURE__ */ jsx(
8143
+ DataTable,
8144
+ {
8145
+ columns,
8146
+ data: mockStatementTransactions,
8147
+ emptyMessage: "No transactions found"
8148
+ }
8149
+ ) })
8150
+ ] })
8151
+ ] })
8152
+ ] });
8153
+ }
8154
+
7181
8155
  // src/lib/mock-data/transaction-data.ts
7182
8156
  var mockTransactions = [
7183
8157
  {
@@ -8587,6 +9561,6 @@ function UIKit() {
8587
9561
  ] }) }) });
8588
9562
  }
8589
9563
 
8590
- export { ACHBankCard, ACHBasicInfoCard, ACHDetailsSection, ACHTransferSection, AccountCard, AddressForm, AlertDetail_default as AlertDetail, AlertDocuments, AlertNotes, AlertTimeline, Alerts_default as Alerts, AppSidebar, Badge, BankAddressCard, BankingDetailsCard, BasicInfoCard, BasicInfoSection, BeneficiaryAddress, BeneficiaryCard, BeneficiaryDomesticWire, Breadcrumb, Business_default as Business, BusinessProfileCard, BusinessStatusCard, BusinessTypeBadge, Button, Calendar, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Cases_default as Cases, ContactInfoCard, Container, ContextSection, CounterpartyBasicInfo, DomesticWire_default as CounterpartyDomesticWire, Manage_default as CounterpartyManage, CounterpartyProfileCard, CounterpartyRecordsCard, CounterpartyTypeBadge, Create_default as CreateBusiness, Create_default2 as CreateCounterparty, Dashboard_default as Dashboard, DashboardDemo, DataGrid, DataTable, DetailPageLayout, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuTrigger, EditableFormCard, EditableInfoField, EnhancedInput, EnhancedSelect, EnhancedTextarea, EntityCard, FormCard, FormField, FormInput, FormProvider, FormSection, FormSelect, InfoField, IntermediaryCard, IntermediaryFI, IntermediaryFIAddress, JsonViewer, Label, ListPage, MainLayout, MetricCard, NewTransaction, NotFound_default as NotFound, OriginatorCard, OriginatorFI, OriginatorFIAddress, PageLayout, PatternLibrary, PaymentInformationSection, Popover, PopoverContent, PopoverTrigger, ReceiverCard, ResponsiveGrid, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, Stack, StatusBadge, Tabs, TabsContent, TabsList, TabsTrigger, Toast, ToastAction, ToastClose, ToastDescription, ToastProvider, ToastTitle, ToastViewport, Toaster, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, TransactionDetail_default as TransactionDetail, TransactionHistory_default as TransactionHistory, UIKit, UIKitShowcase, WireDetailsSection, WireTransferSection, badgeVariants, buttonVariants, cardVariants, inputVariants, reducer, textareaVariants, toast, useEditState, useFormWithEditState, useIsMobile, useSidebar, useToast };
9564
+ export { ACHBankCard, ACHBasicInfoCard, ACHDetailsSection, ACHTransferSection, AccountCard, AddressForm, AlertDetail_default as AlertDetail, AlertDetailView, AlertDocuments, AlertNotes, AlertTimeline, Alerts_default as Alerts, AppSidebar, Badge, BankAddressCard, BankingDetailsCard, BasicInfoCard, BasicInfoSection, BeneficiaryAddress, BeneficiaryCard, BeneficiaryDomesticWire, Breadcrumb, BusinessDetail_default as BusinessDetail, BusinessProfileCard, BusinessStatusCard, BusinessTypeBadge, Businesses_default as Businesses, Button, Calendar, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Cases_default as Cases, ContactInfoCard, Container, ContextSection, CounterpartyBasicInfo, DomesticWire_default as CounterpartyDomesticWire, Manage_default as CounterpartyManage, CounterpartyProfileCard, CounterpartyRecordsCard, CounterpartyTypeBadge, Create_default as CreateBusiness, Create_default2 as CreateCounterparty, Dashboard_default as Dashboard, DashboardDemo, DataGrid, DataTable, DetailPageLayout, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuTrigger, EditableFormCard, EditableInfoField, EnhancedInput, EnhancedSelect, EnhancedTextarea, EntityCard, FormCard, FormField, FormInput, FormProvider, FormSection, FormSelect, InfoField, IntermediaryCard, IntermediaryFI, IntermediaryFIAddress, JsonViewer, Label, ListPage, MainLayout, MetricCard, NewTransaction, NotFound_default as NotFound, OriginatorCard, OriginatorFI, OriginatorFIAddress, PageLayout, PatternLibrary, PaymentInformationSection, Popover, PopoverContent, PopoverTrigger, ReceiverCard, ResponsiveGrid, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, Stack, Statement, StatementHeader, StatusBadge, Tabs, TabsContent, TabsList, TabsTrigger, Toast, ToastAction, ToastClose, ToastDescription, ToastProvider, ToastTitle, ToastViewport, Toaster, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, TransactionDetail_default as TransactionDetail, TransactionHistory_default as TransactionHistory, UIKit, UIKitShowcase, WireDetailsSection, WireTransferSection, badgeVariants, buttonVariants, cardVariants, inputVariants, reducer, textareaVariants, toast, useAlertDetail, useEditState, useFormWithEditState, useIsMobile, useSidebar, useToast };
8591
9565
  //# sourceMappingURL=index.js.map
8592
9566
  //# sourceMappingURL=index.js.map