Skip to content

A modern platform for visual, flexible, and extensible graph-based investigations. For cybersecurity analysts and investigators.

feat: nodes colors

dextmorgne96b5ec1311b
diff --git a/flowsint-web/src/app/api/projects/[project_id]/investigations/[investigation_id]/data/route.ts b/flowsint-web/src/app/api/projects/[project_id]/investigations/[investigation_id]/data/route.ts
index d66917b1..cc4c3bf0 100644
--- a/flowsint-web/src/app/api/projects/[project_id]/investigations/[investigation_id]/data/route.ts
+++ b/flowsint-web/src/app/api/projects/[project_id]/investigations/[investigation_id]/data/route.ts
@@ -132,7 +132,7 @@ export async function GET(_: Request, { params }: { params: Promise<{ investigat
nodes.push({
id: vehicle.id.toString(),
type: "vehicle",
- data: { label: `${vehicle.plate}-${vehicle.model}` },
+ data: { label: `${vehicle.plate}-${vehicle.model || "Unknown"}`, ...vehicle },
position: { x: -100, y: -100 },
})
edges.push({
diff --git a/flowsint-web/src/app/layout.tsx b/flowsint-web/src/app/layout.tsx
index cbcff605..24043ae8 100644
--- a/flowsint-web/src/app/layout.tsx
+++ b/flowsint-web/src/app/layout.tsx
@@ -36,12 +36,12 @@ export default function RootLayout({
return (
<html suppressHydrationWarning lang="en">
<head>
- {/* {process.env.NODE_ENV === "development" && ( */}
+ {process.env.NODE_ENV === "development" && (
<script
crossOrigin="anonymous"
src="//unpkg.com/react-scan/dist/auto.global.js"
/>
- {/* )} */}
+ )}
</head>
<body
className={clsx(
diff --git a/flowsint-web/src/components/investigations/sketch/graph.tsx b/flowsint-web/src/components/investigations/sketch/graph.tsx
index ceeea0e3..c5378268 100644
--- a/flowsint-web/src/components/investigations/sketch/graph.tsx
+++ b/flowsint-web/src/components/investigations/sketch/graph.tsx
@@ -59,6 +59,7 @@ import {
} from "@/components/ui/resizable"
import NodesPanel from "./nodes-panel"
import ProfilePanel from "./profile-panel"
+import Vehicle from "./nodes/vehicle"
const edgeTypes = {
custom: CustomEdge,
@@ -71,7 +72,8 @@ const nodeTypes = {
social: SocialNode,
address: AddressNode,
group: GroupNode,
- default: BaseNode
+ default: BaseNode,
+ vehicle: Vehicle
}
const nodeEdgeSelector = (store: { nodes: any; edges: any }) => ({
nodes: store.nodes,
diff --git a/flowsint-web/src/components/investigations/sketch/nodes-panel.tsx b/flowsint-web/src/components/investigations/sketch/nodes-panel.tsx
index 69fa5b6a..17652bb4 100644
--- a/flowsint-web/src/components/investigations/sketch/nodes-panel.tsx
+++ b/flowsint-web/src/components/investigations/sketch/nodes-panel.tsx
@@ -6,7 +6,7 @@ import { Avatar, AvatarFallback, AvatarImage } from '@/components/ui/avatar'
import { Badge } from '@/components/ui/badge'
import { TypeBadge } from '@/components/type-badge'
import { Card, CardContent } from "@/components/ui/card"
-import { AtSignIcon, Mail, User, UserIcon, Users } from "lucide-react"
+import { AtSignIcon, CarIcon, Mail, User, UserIcon, Users } from "lucide-react"
import { usePlatformIcons } from '@/lib/hooks/use-platform-icons'
interface NodeProps {
@@ -52,7 +52,16 @@ export function NodeRenderer({ node, setCurrentNode }: NodeProps) {
<Badge variant="secondary" className="h-7 w-7 p-0 rounded-full">
<AtSignIcon className="h-4 w-4 opacity-60" />
</Badge>
- <div className='grow truncate text-ellipsis'>{node?.data?.full_name || node?.data?.label}</div>
+ <div className='grow truncate text-ellipsis'>{node?.data?.label}</div>
+ <TypeBadge type={node?.type}></TypeBadge>
+ </Button>
+ )}
+ {node.type === "vehicle" && (
+ <Button variant={"ghost"} className='flex items-center justify-start p-4 !py-5 rounded-none text-left border-b' onClick={() => setCurrentNode(node)}>
+ <Badge variant="secondary" className="h-7 w-7 p-0 rounded-full">
+ <CarIcon className="h-4 w-4 opacity-60" />
+ </Badge>
+ <div className='grow truncate text-ellipsis'>{node?.data?.label}</div>
<TypeBadge type={node?.type}></TypeBadge>
</Button>
)}
diff --git a/flowsint-web/src/components/investigations/sketch/nodes/custom-edge.tsx b/flowsint-web/src/components/investigations/sketch/nodes/custom-edge.tsx
index 884fe768..d16f9baf 100644
--- a/flowsint-web/src/components/investigations/sketch/nodes/custom-edge.tsx
+++ b/flowsint-web/src/components/investigations/sketch/nodes/custom-edge.tsx
@@ -95,7 +95,6 @@ const EditableEdge = memo((props: EdgeProps) => {
</div>
);
}
-
return (
<Button
onClick={handleEditClick}
diff --git a/flowsint-web/src/components/investigations/sketch/nodes/email.tsx b/flowsint-web/src/components/investigations/sketch/nodes/email.tsx
index 9ffec561..4e6f855f 100644
--- a/flowsint-web/src/components/investigations/sketch/nodes/email.tsx
+++ b/flowsint-web/src/components/investigations/sketch/nodes/email.tsx
@@ -4,12 +4,13 @@ import { Badge } from '@/components/ui/badge';
import { AtSignIcon } from 'lucide-react';
import { BaseNode } from '@/components/ui/base-node';
import { Handle, Position } from '@xyflow/react';
+import { cn, typeColorMap } from '@/lib/utils';
export default memo(({ data, selected }: any) => {
return (
- <BaseNode className='p-.5 rounded-full' selected={selected}>
+ <BaseNode className={cn('p-.5 rounded-full', typeColorMap["email"])} selected={selected}>
<div className="flex items-center gap-2 p-1">
- <Badge variant="secondary" className="h-6 w-6 p-0 rounded-full">
+ <Badge variant="secondary" className="h-6 w-6 p-0 rounded-full dark:bg-emerald-900 bg-emerald-200">
<AtSignIcon className="h-4 w-4" />
</Badge>
<div className="flex items-center gap-1">
diff --git a/flowsint-web/src/components/investigations/sketch/nodes/ip_address.tsx b/flowsint-web/src/components/investigations/sketch/nodes/ip_address.tsx
index 5e2d428e..178f3f7e 100644
--- a/flowsint-web/src/components/investigations/sketch/nodes/ip_address.tsx
+++ b/flowsint-web/src/components/investigations/sketch/nodes/ip_address.tsx
@@ -4,10 +4,11 @@ import { Badge } from '@/components/ui/badge';
import { LocateIcon } from 'lucide-react';
import { BaseNode } from '@/components/ui/base-node';
import { Handle, Position } from '@xyflow/react';
+import { cn, typeColorMap } from '@/lib/utils';
export default memo(({ data, selected }: any) => {
return (
- <BaseNode className='p-.5 rounded-full' selected={selected}>
+ <BaseNode className={cn('p-.5 rounded-full', typeColorMap["ip_address"])} selected={selected}>
<div className="flex items-center gap-2 p-1">
<Badge variant="secondary" className="h-6 w-6 p-0 rounded-full">
<LocateIcon className="h-4 w-4" />
diff --git a/flowsint-web/src/components/investigations/sketch/nodes/node-context-menu.tsx b/flowsint-web/src/components/investigations/sketch/nodes/node-context-menu.tsx
index 77061049..5b5a0bbb 100644
--- a/flowsint-web/src/components/investigations/sketch/nodes/node-context-menu.tsx
+++ b/flowsint-web/src/components/investigations/sketch/nodes/node-context-menu.tsx
@@ -258,16 +258,18 @@ const NodeContextMenu = memo(({ x, y, onClose }: NodeContextMenuProps) => {
{Boolean(currentNode?.data?.email) && (
<DropdownMenuItem onClick={handleCheckEmail}>Search {currentNodeType}</DropdownMenuItem>
)}
+ {currentNode?.type === "individual" && (
+ <DropdownMenuSub>
+ <DropdownMenuSubTrigger>New</DropdownMenuSubTrigger>
+ <DropdownMenuSubContent className="grid grid-cols-1 md:grid-cols-2 gap-2">{actionItems.map((item) => renderMenuItem(item))}</DropdownMenuSubContent>
+ </DropdownMenuSub>)}
+ <DropdownMenuItem onClick={handleEditClick}>View and edit</DropdownMenuItem>
+ <DropdownMenuItem onClick={handleDuplicateClick}>Duplicate</DropdownMenuItem>
+ <DropdownMenuSeparator />
<DropdownMenuItem onClick={handleNoteClick}>
New note
<SquarePenIcon className="ml-2 h-4 w-4" />
</DropdownMenuItem>
- <DropdownMenuSub>
- <DropdownMenuSubTrigger>New</DropdownMenuSubTrigger>
- <DropdownMenuSubContent className="grid grid-cols-1 md:grid-cols-2 gap-2">{actionItems.map((item) => renderMenuItem(item))}</DropdownMenuSubContent>
- </DropdownMenuSub>
- <DropdownMenuItem onClick={handleEditClick}>View and edit</DropdownMenuItem>
- <DropdownMenuItem onClick={handleDuplicateClick}>Duplicate</DropdownMenuItem>
<DropdownMenuSeparator />
<DropdownMenuItem onClick={handleDeleteClick} className="text-red-600">
Delete
diff --git a/flowsint-web/src/components/investigations/sketch/nodes/person.tsx b/flowsint-web/src/components/investigations/sketch/nodes/person.tsx
index cf43bd8b..ae73cf7b 100644
--- a/flowsint-web/src/components/investigations/sketch/nodes/person.tsx
+++ b/flowsint-web/src/components/investigations/sketch/nodes/person.tsx
@@ -4,12 +4,13 @@ import { CopyButton } from '@/components/copy';
import { Avatar, AvatarImage } from '@/components/ui/avatar';
import { BaseNode } from "@/components/ui/base-node";
import { UserIcon } from 'lucide-react';
+import { cn, typeColorMap } from '@/lib/utils';
export default memo(({ data, selected }: any) => {
return (
- <BaseNode selected={selected}>
+ <BaseNode selected={selected} className={cn('p-1 rounded-full', typeColorMap["individual"])} >
<div className="flex gap-2 items-center rounded-full">
- <Avatar className="h-9 w-9 flex items-center justify-center">
+ <Avatar className="h-9 w-9 flex items-center justify-center dark:bg-slate-900 bg-slate-200">
<AvatarImage src={data?.image_url} alt={data.full_name} />
<UserIcon className="h-4 w-4 opacity-60" />
</Avatar>
diff --git a/flowsint-web/src/components/investigations/sketch/nodes/phone.tsx b/flowsint-web/src/components/investigations/sketch/nodes/phone.tsx
index 57af9c59..63dad487 100644
--- a/flowsint-web/src/components/investigations/sketch/nodes/phone.tsx
+++ b/flowsint-web/src/components/investigations/sketch/nodes/phone.tsx
@@ -4,10 +4,11 @@ import { Badge } from '@/components/ui/badge';
import { PhoneIcon } from 'lucide-react';
import { BaseNode } from '@/components/ui/base-node';
import { Handle, Position } from '@xyflow/react';
+import { cn, typeColorMap } from '@/lib/utils';
export default memo(({ data, selected }: any) => {
return (
- <BaseNode className='p-.5 rounded-full' selected={selected}>
+ <BaseNode className={cn('p-.5 rounded-full', typeColorMap["phone_number"])} selected={selected}>
<div className="flex items-center gap-2 p-1">
<Badge variant="secondary" className="h-6 w-6 p-0 rounded-full">
<PhoneIcon className="h-4 w-4" />
diff --git a/flowsint-web/src/components/investigations/sketch/nodes/physical_address.tsx b/flowsint-web/src/components/investigations/sketch/nodes/physical_address.tsx
index 54b6b271..af57f509 100644
--- a/flowsint-web/src/components/investigations/sketch/nodes/physical_address.tsx
+++ b/flowsint-web/src/components/investigations/sketch/nodes/physical_address.tsx
@@ -4,10 +4,11 @@ import { Badge } from '@/components/ui/badge';
import { LocateIcon } from 'lucide-react';
import { BaseNode } from '@/components/ui/base-node';
import { Handle, Position } from '@xyflow/react';
+import { cn, typeColorMap } from '@/lib/utils';
export default memo(({ data, selected }: any) => {
return (
- <BaseNode className='p-.5 rounded-full' selected={selected}>
+ <BaseNode className={cn('p-.5 rounded-full', typeColorMap["physical_address"])} selected={selected}>
<div className="flex items-center gap-2 p-1">
<Badge variant="secondary" className="h-6 w-6 p-0 rounded-full">
<LocateIcon className="h-4 w-4" />
diff --git a/flowsint-web/src/components/investigations/sketch/nodes/social.tsx b/flowsint-web/src/components/investigations/sketch/nodes/social.tsx
index 2ac80d3f..b6d88c3c 100644
--- a/flowsint-web/src/components/investigations/sketch/nodes/social.tsx
+++ b/flowsint-web/src/components/investigations/sketch/nodes/social.tsx
@@ -4,17 +4,20 @@ import { CopyButton } from '@/components/copy';
import { Badge } from '@/components/ui/badge';
import { usePlatformIcons } from '@/lib/hooks/use-platform-icons';
import { BaseNode } from '@/components/ui/base-node';
+import { cn, typeColorMap } from '@/lib/utils';
export default memo(({ data, selected }: any) => {
const platformsIcons = usePlatformIcons()
- const platformIcon = useMemo(() => {
+ const { platformIcon, color } = useMemo(() => {
// @ts-ignore
- return platformsIcons?.[data?.platform]?.icon
+ return {
+ platformIcon: platformsIcons?.[data?.platform]?.icon, color: platformsIcons?.[data?.platform]?.color
+ }
}, [platformsIcons, data?.platform])
return (
- <BaseNode className='p-.5 rounded-full' selected={selected}>
+ <BaseNode className={cn('p-.5 rounded-full', typeColorMap["social"])} selected={selected}>
<div className="flex items-center gap-2 p-1">
- <Badge variant="secondary" className="h-6 w-6 p-0 rounded-full">
+ <Badge variant="secondary" className="h-6 w-6 p-0 rounded-full dark:bg-purple-900 bg-purple-200">
{platformIcon}
</Badge>
<div className="flex items-center gap-1">
diff --git a/flowsint-web/src/components/investigations/sketch/nodes/vehicle.tsx b/flowsint-web/src/components/investigations/sketch/nodes/vehicle.tsx
new file mode 100644
index 00000000..04d47ef2
--- /dev/null
+++ b/flowsint-web/src/components/investigations/sketch/nodes/vehicle.tsx
@@ -0,0 +1,35 @@
+import React, { memo } from 'react';
+import { CopyButton } from '@/components/copy';
+import { Badge } from '@/components/ui/badge';
+import { CarIcon, PhoneIcon } from 'lucide-react';
+import { BaseNode } from '@/components/ui/base-node';
+import { Handle, Position } from '@xyflow/react';
+import { cn, typeColorMap } from '@/lib/utils';
+
+export default memo(({ data, selected }: any) => {
+ return (
+ <BaseNode className={cn('p-.5 rounded-full', typeColorMap["vehicle"])} selected={selected}>
+ <div className="flex items-center gap-2 p-1">
+ <Badge variant="secondary" className="h-6 w-6 p-0 rounded-full">
+ <CarIcon className="h-4 w-4" />
+ </Badge>
+ <div className="flex items-center gap-1">
+ <span className="text-sm">{data.label}</span>
+ <CopyButton className="rounded-full h-7 w-7 text-xs" content={data.label} />
+ </div>
+ </div>
+ <Handle
+ type="target"
+ style={{ visibility: "hidden" }}
+ position={Position.Top}
+ isConnectable={false}
+ />
+ <Handle
+ type="source"
+ style={{ visibility: "hidden" }}
+ position={Position.Bottom}
+ isConnectable={false}
+ />
+ </BaseNode>
+ );
+});
\ No newline at end of file
diff --git a/flowsint-web/src/components/investigations/sketch/profile-panel.tsx b/flowsint-web/src/components/investigations/sketch/profile-panel.tsx
index c0b1d8ef..66b31ac8 100644
--- a/flowsint-web/src/components/investigations/sketch/profile-panel.tsx
+++ b/flowsint-web/src/components/investigations/sketch/profile-panel.tsx
@@ -8,6 +8,8 @@ import { Button } from "@/components/ui/button"
import Link from "next/link"
import { useParams } from "next/navigation"
import SearchEmail from "./search-email"
+import { memo } from "react"
+import { cn } from "@/lib/utils"
export default function ProfilePanel({ data, type }: { data: any, type: "individual" | "email" }) {
const { project_id, investigation_id } = useParams()
@@ -87,7 +89,7 @@ export default function ProfilePanel({ data, type }: { data: any, type: "individ
{/* Left column with avatar */}
<div className="flex flex-col items-center gap-6">
<div className="relative flex flex-col items-center gap-4">
- <Avatar className="w-28 h-28 border-4 border-primary/20">
+ <Avatar className="w-28 h-28 border-4">
<AvatarImage src={data.image_url} alt={data.full_name} />
<AvatarFallback className="text-2xl">
{data.full_name
@@ -100,16 +102,16 @@ export default function ProfilePanel({ data, type }: { data: any, type: "individ
<Button variant={"outline"}>View</Button>
</Link>
</div>
- <div className="space-y-1 text-center md:text-left">
- <div className="flex items-center gap-2 text-primary">
+ <div className="space-y-1 text-center">
+ <div className="flex items-center justify-center gap-2 text-primary">
<User className="h-4 w-4" />
<span className="text-sm">Full Name</span>
</div>
<h1 className="text-2xl font-bold tracking-tight">{data.full_name}</h1>
</div>
- <div className="space-y-1 text-center md:text-left">
- <div className="flex items-center gap-2 text-primary">
+ <div className="space-y-1 text-center">
+ <div className="flex items-center justify-center gap-2 text-primary">
<Info className="h-4 w-4" />
<span className="text-sm">Investigation ID</span>
</div>
@@ -120,40 +122,40 @@ export default function ProfilePanel({ data, type }: { data: any, type: "individ
{/* Middle column */}
<div className="space-y-6">
<div className="space-y-1">
- <div className="flex items-center gap-2 text-primary">
+ <div className="flex items-center justify-center gap-2 text-primary">
<AtSign className="h-4 w-4" />
- <span className="text-sm">Email</span>
+ <span className="text-sm text-center">Email</span>
</div>
{data?.emails?.length > 0 ? (
- <p className="font-medium">{data?.emails?.[0].email}</p>
+ <p className="font-medium text-center">{data?.emails?.[0].email}</p>
) : (
- <p className="text-gray-500">No email available</p>
+ <p className="text-gray-500 text-center">No email available</p>
)}
</div>
<div className="space-y-1">
- <div className="flex items-center gap-2 text-primary">
+ <div className="flex items-center justify-center gap-2 text-primary">
<Globe className="h-4 w-4" />
- <span className="text-sm">Nationality</span>
+ <span className="text-sm text-center">Nationality</span>
</div>
- <p className="font-medium">{data.nationality || "Unknown"}</p>
+ <p className="font-medium text-center">{data.nationality || "Unknown"}</p>
</div>
<div className="space-y-1">
- <div className="flex items-center gap-2 text-primary">
+ <div className="flex items-center justify-center gap-2 text-primary">
<User className="h-4 w-4" />
- <span className="text-sm">Gender</span>
+ <span className="text-sm text-center">Gender</span>
</div>
- <p className="font-medium">{data.gender || "Unknown"}</p>
+ <p className="font-medium text-center">{data.gender || "Unknown"}</p>
</div>
{data?.phone_numbers?.length > 0 && (
<div className="space-y-1">
- <div className="flex items-center gap-2 text-primary">
+ <div className="flex items-center justify-center gap-2 text-primary">
<Phone className="h-4 w-4" />
- <span className="text-sm">Phone Number</span>
+ <span className="text-sm text-center">Phone Number</span>
</div>
- <p className="font-medium">{data?.phone_numbers?.[0]}</p>
+ <p className="font-medium text-center">{data?.phone_numbers?.[0]}</p>
</div>
)}
</div>
@@ -162,20 +164,20 @@ export default function ProfilePanel({ data, type }: { data: any, type: "individ
<div className="space-y-6">
{data.birth_date && (
<div className="space-y-1">
- <div className="flex items-center gap-2 text-primary">
+ <div className="flex items-center justify-center gap-2 text-primary">
<Calendar className="h-4 w-4" />
- <span className="text-sm">Birth Date</span>
+ <span className="text-sm text-center">Birth Date</span>
</div>
- <p className="font-medium">{data.birth_date}</p>
+ <p className="font-medium text-center">{data.birth_date}</p>
</div>
)}
<div className="space-y-1">
- <div className="flex items-center gap-2 text-primary">
+ <div className="flex items-center justify-center gap-2 text-primary">
<Info className="h-4 w-4" />
- <span className="text-sm">Email Security</span>
+ <span className="text-sm text-center">Email Security</span>
</div>
- <div className="flex gap-2 mt-1">
+ <div className="flex gap-2 mt-1 justify-center">
{data?.emails?.length > 0 && (
<Badge
variant={data.emails?.[0].breach_found ? "destructive" : "outline"}
@@ -188,25 +190,48 @@ export default function ProfilePanel({ data, type }: { data: any, type: "individ
{data.physical_addresses?.length > 0 && (
<div className="space-y-1">
- <div className="flex items-center gap-2 text-primary">
+ <div className="flex items-center justify-center gap-2 text-primary">
<MapPin className="h-4 w-4" />
- <span className="text-sm">Location</span>
+ <span className="text-sm text-center">Location</span>
</div>
- <p className="font-medium">{data.physical_addresses?.[0]}</p>
+ <p className="font-medium text-center">{data.physical_addresses?.[0]}</p>
</div>
)}
<div className="space-y-1">
- <div className="flex items-center gap-2 text-primary">
+ <div className="flex items-center justify-center gap-2 text-primary">
<Info className="h-4 w-4" />
<span className="text-sm">Individual ID</span>
</div>
- <p className="text-xs font-mono text-gray-400">{data.id}</p>
+ <p className="text-xs font-mono text-gray-400 text-center">{data.id}</p>
</div>
</div>
</div>
</div>
</div>
)
+
+ return (
+ <KeyValueDisplay data={data} />
+ )
+}
+
+interface KeyValueDisplayProps {
+ data: Record<string, any>
+ className?: string
+}
+
+function KeyValueDisplay({ data, className }: KeyValueDisplayProps) {
+ return (
+ <div className={cn("w-full overflow-y-auto h-full border-collapse ", className)}>
+ {Object.entries(data).map(([key, value], index) => (
+ <div key={index} className="flex w-full border-b border-border divide-x divide-border">
+ <div className="w-1/2 bg-background px-4 p-2 text-sm font-medium text-muted-foreground">{key}</div>
+ <div className="w-1/2 bg-background px-4 p-2 text-sm font-medium">{value?.toString() || ""}</div>
+ </div>
+ ))}
+ </div>
+ )
}
+export const MemoizedKeyValueDisplay = memo(KeyValueDisplay)
\ No newline at end of file
diff --git a/flowsint-web/src/components/type-badge.tsx b/flowsint-web/src/components/type-badge.tsx
index d46cff41..21419ea8 100644
--- a/flowsint-web/src/components/type-badge.tsx
+++ b/flowsint-web/src/components/type-badge.tsx
@@ -1,5 +1,5 @@
import { Badge } from "@/components/ui/badge"
-import { cn } from "@/lib/utils"
+import { cn, typeColorMap } from "@/lib/utils"
import { memo } from "react"
type TypeBadgeProps = {
@@ -7,29 +7,6 @@ type TypeBadgeProps = {
className?: string
}
-const typeColorMap: Record<string, string> = {
- individual: "bg-emerald-100 text-emerald-800 hover:bg-emerald-100/80 dark:bg-emerald-900/30 dark:text-emerald-300 dark:hover:bg-emerald-900/40",
- phone: "bg-sky-100 text-sky-800 hover:bg-sky-100/80 dark:bg-sky-900/30 dark:text-sky-300 dark:hover:bg-sky-900/40",
- address: "bg-amber-100 text-amber-800 hover:bg-amber-100/80 dark:bg-amber-900/30 dark:text-amber-300 dark:hover:bg-amber-900/40",
- email: "bg-violet-100 text-violet-800 hover:bg-violet-100/80 dark:bg-violet-900/30 dark:text-violet-300 dark:hover:bg-violet-900/40",
- ip: "bg-slate-100 text-slate-800 hover:bg-slate-100/80 dark:bg-slate-800/50 dark:text-slate-300 dark:hover:bg-slate-800/60",
- social_account: "bg-pink-100 text-pink-800 hover:bg-pink-100/80 dark:bg-pink-900/30 dark:text-pink-300 dark:hover:bg-pink-900/40",
- vehicle: "bg-cyan-100 text-cyan-800 hover:bg-cyan-100/80 dark:bg-cyan-900/30 dark:text-cyan-300 dark:hover:bg-cyan-900/40",
- organization: "bg-orange-100 text-orange-800 hover:bg-orange-100/80 dark:bg-orange-900/30 dark:text-orange-300 dark:hover:bg-orange-900/40",
- website: "bg-purple-100 text-purple-800 hover:bg-purple-100/80 dark:bg-purple-900/30 dark:text-purple-300 dark:hover:bg-purple-900/40",
- document: "bg-yellow-100 text-yellow-800 hover:bg-yellow-100/80 dark:bg-yellow-900/30 dark:text-yellow-300 dark:hover:bg-yellow-900/40",
- financial: "bg-green-100 text-green-800 hover:bg-green-100/80 dark:bg-green-900/30 dark:text-green-300 dark:hover:bg-green-900/40",
- event: "bg-red-100 text-red-800 hover:bg-red-100/80 dark:bg-red-900/30 dark:text-red-300 dark:hover:bg-red-900/40",
- device: "bg-blue-100 text-blue-800 hover:bg-blue-100/80 dark:bg-blue-900/30 dark:text-blue-300 dark:hover:bg-blue-900/40",
- media: "bg-fuchsia-100 text-fuchsia-800 hover:bg-fuchsia-100/80 dark:bg-fuchsia-900/30 dark:text-fuchsia-300 dark:hover:bg-fuchsia-900/40",
- education: "bg-teal-100 text-teal-800 hover:bg-teal-100/80 dark:bg-teal-900/30 dark:text-teal-300 dark:hover:bg-teal-900/40",
- relationship: "bg-rose-100 text-rose-800 hover:bg-rose-100/80 dark:bg-rose-900/30 dark:text-rose-300 dark:hover:bg-rose-900/40",
- online_activity: "bg-indigo-100 text-indigo-800 hover:bg-indigo-100/80 dark:bg-indigo-900/30 dark:text-indigo-300 dark:hover:bg-indigo-900/40",
- digital_footprint: "bg-lime-100 text-lime-800 hover:bg-lime-100/80 dark:bg-lime-900/30 dark:text-lime-300 dark:hover:bg-lime-900/40",
- biometric: "bg-amber-100 text-amber-800 hover:bg-amber-100/80 dark:bg-amber-900/30 dark:text-amber-300 dark:hover:bg-amber-900/40",
- credential: "bg-gray-100 text-gray-800 hover:bg-gray-100/80 dark:bg-gray-800/50 dark:text-gray-300 dark:hover:bg-gray-800/60",
-}
-
function TypeBadgeComponent({ type, className }: TypeBadgeProps) {
const colorClasses = typeColorMap[type] || "bg-gray-100 text-gray-800 hover:bg-gray-100/80 dark:bg-gray-800/50 dark:text-gray-300 dark:hover:bg-gray-800/60"
diff --git a/flowsint-web/src/lib/hooks/use-platform-icons.tsx b/flowsint-web/src/lib/hooks/use-platform-icons.tsx
index ad3bd739..5f9223c6 100644
--- a/flowsint-web/src/lib/hooks/use-platform-icons.tsx
+++ b/flowsint-web/src/lib/hooks/use-platform-icons.tsx
@@ -5,12 +5,13 @@ export const usePlatformIcons = () => {
return useMemo(() => {
if (!actionItems[5]?.children)
return {};
- return actionItems[5].children.reduce((acc: Record<string, { icon: JSX.Element }>, item: ActionItem) => {
+ return actionItems[5].children.reduce((acc: Record<string, { icon: JSX.Element, color: string }>, item: ActionItem) => {
const platform = item.key.split("_")[2];
acc[platform] = {
icon: <item.icon style={{ color: item.color }} />,
+ color: item.color ?? "lightgray",
};
return acc;
- }, {} as Record<string, { icon: JSX.Element }>);
+ }, {} as Record<string, { icon: JSX.Element, color: string }>);
}, []);
};
\ No newline at end of file
diff --git a/flowsint-web/src/lib/utils.ts b/flowsint-web/src/lib/utils.ts
index ede1c142..c33b6449 100644
--- a/flowsint-web/src/lib/utils.ts
+++ b/flowsint-web/src/lib/utils.ts
@@ -474,3 +474,25 @@ export const nodesTypes = {
},
}
+export const typeColorMap: Record<string, string> = {
+ individual: "rounded-full bg-gradient-to-br from-slate-50 to-slate-100 border-slate-200 shadow-md dark:from-slate-800 dark:to-slate-900 dark:border-slate-700 dark:shadow-slate-900/30",
+ phone_number: "bg-sky-100 text-sky-800 hover:bg-sky-100/80 dark:bg-sky-900/30 dark:text-sky-300 dark:hover:bg-sky-900/40",
+ address: "bg-amber-100 text-amber-800 hover:bg-amber-100/80 dark:bg-amber-900/30 dark:text-amber-300 dark:hover:bg-amber-900/40",
+ email: "bg-gradient-to-br from-emerald-50 to-emerald-100 border-emerald-200 shadow-sm dark:from-emerald-950 dark:to-emerald-900 dark:border-emerald-800 dark:shadow-emerald-900/30",
+ ip_address: "bg-slate-100 text-slate-800 hover:bg-slate-100/80 dark:bg-slate-800/50 dark:text-slate-300 dark:hover:bg-slate-800/60",
+ social: "bg-gradient-to-br from-purple-50 to-purple-100 border-purple-200 shadow-sm dark:from-purple-950 dark:to-purple-900 dark:border-purple-800 dark:shadow-purple-900/30",
+ organization: "bg-gradient-to-br from-orange-50 to-orange-100 border-orange-200 shadow-sm dark:from-orange-950 dark:to-orange-900 dark:border-orange-800 dark:shadow-orange-900/30",
+ vehicle: "bg-orange-100 text-orange-800 hover:bg-orange-100/80 dark:bg-orange-900/30 dark:text-orange-300 dark:hover:bg-orange-900/40",
+ website: "bg-purple-100 text-purple-800 hover:bg-purple-100/80 dark:bg-purple-900/30 dark:text-purple-300 dark:hover:bg-purple-900/40",
+ document: "bg-yellow-100 text-yellow-800 hover:bg-yellow-100/80 dark:bg-yellow-900/30 dark:text-yellow-300 dark:hover:bg-yellow-900/40",
+ financial: "bg-green-100 text-green-800 hover:bg-green-100/80 dark:bg-green-900/30 dark:text-green-300 dark:hover:bg-green-900/40",
+ event: "bg-red-100 text-red-800 hover:bg-red-100/80 dark:bg-red-900/30 dark:text-red-300 dark:hover:bg-red-900/40",
+ device: "bg-blue-100 text-blue-800 hover:bg-blue-100/80 dark:bg-blue-900/30 dark:text-blue-300 dark:hover:bg-blue-900/40",
+ media: "bg-fuchsia-100 text-fuchsia-800 hover:bg-fuchsia-100/80 dark:bg-fuchsia-900/30 dark:text-fuchsia-300 dark:hover:bg-fuchsia-900/40",
+ education: "bg-teal-100 text-teal-800 hover:bg-teal-100/80 dark:bg-teal-900/30 dark:text-teal-300 dark:hover:bg-teal-900/40",
+ relationship: "bg-rose-100 text-rose-800 hover:bg-rose-100/80 dark:bg-rose-900/30 dark:text-rose-300 dark:hover:bg-rose-900/40",
+ online_activity: "bg-indigo-100 text-indigo-800 hover:bg-indigo-100/80 dark:bg-indigo-900/30 dark:text-indigo-300 dark:hover:bg-indigo-900/40",
+ digital_footprint: "bg-lime-100 text-lime-800 hover:bg-lime-100/80 dark:bg-lime-900/30 dark:text-lime-300 dark:hover:bg-lime-900/40",
+ biometric: "bg-amber-100 text-amber-800 hover:bg-amber-100/80 dark:bg-amber-900/30 dark:text-amber-300 dark:hover:bg-amber-900/40",
+ credential: "bg-gray-100 text-gray-800 hover:bg-gray-100/80 dark:bg-gray-800/50 dark:text-gray-300 dark:hover:bg-gray-800/60",
+}
\ No newline at end of file