@omnsight/osint-entity-components 0.2.3 → 0.2.5

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/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "0.2.3",
6
+ "version": "0.2.5",
7
7
  "engines": {
8
8
  "node": ">=24.0.0"
9
9
  },
@@ -1,4 +1,5 @@
1
1
  import "../avatars/layouts/EntityStyles.css";
2
+ import { LinkIcon } from "@heroicons/react/24/solid";
2
3
  import { ActionIcon, Avatar, Group, Tooltip, Text } from "@mantine/core";
3
4
  import type { Source, Relation } from "omni-osint-crud-client";
4
5
  import { RelationTooltip } from "./layouts/RelationTooltip";
@@ -58,10 +59,46 @@ export const SourceAvatarRow: React.FC<Props> = ({
58
59
  </Text>
59
60
  </Tooltip>
60
61
  {data.url && (
61
- <ActionIcon variant="subtle" size="sm">
62
- <SourceIcon source={data} />
62
+ <ActionIcon
63
+ variant="subtle"
64
+ size="sm"
65
+ component="a"
66
+ href={data.url}
67
+ target="_blank"
68
+ >
69
+ <LinkIcon />
63
70
  </ActionIcon>
64
71
  )}
65
72
  </Group>
66
73
  );
67
74
  };
75
+
76
+ export const SourceLink: React.FC<Props> = ({
77
+ data,
78
+ relation,
79
+ renderTooltip = defaultRenderSourceTooltip,
80
+ }) => {
81
+ if (!data.url) {
82
+ return null;
83
+ }
84
+ return (
85
+ <Tooltip
86
+ key={data._id}
87
+ label={renderTooltip(data, relation)}
88
+ position="left"
89
+ withArrow
90
+ withinPortal
91
+ multiline
92
+ >
93
+ <ActionIcon
94
+ variant="subtle"
95
+ size="sm"
96
+ component="a"
97
+ href={data.url}
98
+ target="_blank"
99
+ >
100
+ <LinkIcon />
101
+ </ActionIcon>
102
+ </Tooltip>
103
+ );
104
+ };
@@ -8,5 +8,5 @@ export { EmptyAvatar } from './EmptyAvatar';
8
8
  export { EventAvatar } from './EventAvatar';
9
9
  export { OrganizationAvatar } from './OrganizationAvatar';
10
10
  export { PersonAvatar } from './PersonAvatar';
11
- export { SourceAvatar, SourceAvatarRow } from './SourceAvatar';
11
+ export { SourceAvatar, SourceAvatarRow, SourceLink } from './SourceAvatar';
12
12
  export { WebsiteAvatar } from './WebsiteAvatar';
@@ -3,9 +3,14 @@ import { Avatar } from '@mantine/core';
3
3
  import { EmptyAvatar } from '../EmptyAvatar';
4
4
 
5
5
  interface Props {
6
+ showEmptyAvatar?: boolean;
6
7
  children: React.ReactNode[];
7
8
  }
8
9
 
9
- export const AvatarSpan: React.FC<Props> = ({ children }) => {
10
- return <Avatar.Group>{children.length === 0 ? <EmptyAvatar /> : children}</Avatar.Group>;
10
+ export const AvatarSpan: React.FC<Props> = ({ showEmptyAvatar = true, children }) => {
11
+ return (
12
+ <Avatar.Group>
13
+ {children.length === 0 && showEmptyAvatar ? <EmptyAvatar /> : children}
14
+ </Avatar.Group>
15
+ );
11
16
  };
@@ -1,7 +1,7 @@
1
+ import React from "react";
1
2
  import { Group, Paper, RingProgress, Stack, Text, Title, ScrollArea } from "@mantine/core";
2
3
  import { type MonitoringSource } from "omni-monitoring-client";
3
4
  import { useTranslation } from "react-i18next";
4
- import React from "react";
5
5
 
6
6
  interface Props {
7
7
  monitoringSource: MonitoringSource;