@omnsight/osint-entity-components 0.2.3 → 0.2.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/package.json
CHANGED
|
@@ -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
|
|
62
|
-
|
|
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
|
+
};
|
package/src/avatars/index.ts
CHANGED
|
@@ -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';
|
|
@@ -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;
|