This commit is contained in:
Sebastian Seedorf
2022-08-18 17:27:32 +02:00
parent b88ae9ceaa
commit fdf0902d93
10 changed files with 62 additions and 33 deletions

View File

@@ -5,10 +5,11 @@ import styles from './NodeOverview.module.css'
import Link from 'next/link'
import { EntityIcon } from '../../home/EntityIcon/EntityIcon'
import { GraphNode } from '../../../src/graph-untangle/types'
import { fixedEncodeURIComponent } from '../../../src/utils'
import { useRouter } from 'next/router'
export type OverviewGraphNode = GraphNode<{
icons: (EnrichedEntity | string)[]
linkOut: string
}>
interface Props extends HTMLProps<HTMLDivElement> {
@@ -16,11 +17,19 @@ interface Props extends HTMLProps<HTMLDivElement> {
}
export const NodeOverview: FC<Props> = ({ node, className, ...props }) => {
const router = useRouter()
return (
<div {...props} className={cx(className, styles.root)}>
<h3>
<span className={styles.linkOut}>
<Link href={node.linkOut}>🔗</Link>
<Link
href={{
pathname: `/visualize/${fixedEncodeURIComponent(node.name)}`,
query: router.query
}}
>
👁
</Link>
</span>
{node.name}
</h3>