🚚 Move 'MiniMapNodeProps' into shared types module.

This commit is contained in:
Hayleigh Thompson
2023-03-09 14:01:55 +00:00
parent afa38727fa
commit 46f3f81dc4
2 changed files with 18 additions and 18 deletions
+1 -17
View File
@@ -1,23 +1,7 @@
import { memo } from 'react';
import type { CSSProperties, MouseEvent } from 'react';
import type { MiniMapNodeProps } from './types';
import cc from 'classcat';
interface MiniMapNodeProps {
id: string;
x: number;
y: number;
width: number;
height: number;
borderRadius: number;
className: string;
color: string;
shapeRendering: string;
strokeColor: string;
strokeWidth: number;
style?: CSSProperties;
onClick?: (event: MouseEvent, id: string) => void;
}
const MiniMapNode = ({
id,
x,
+17 -1
View File
@@ -1,5 +1,5 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
import type { HTMLAttributes, MouseEvent } from 'react';
import type { CSSProperties, HTMLAttributes, MouseEvent } from 'react';
import type { Node, PanelPosition, XYPosition } from '@reactflow/core';
export type GetMiniMapNodeAttribute<NodeData = any> = (node: Node<NodeData>) => string;
@@ -20,3 +20,19 @@ export type MiniMapProps<NodeData = any> = Omit<HTMLAttributes<SVGSVGElement>, '
zoomable?: boolean;
ariaLabel?: string | null;
};
export interface MiniMapNodeProps {
id: string;
x: number;
y: number;
width: number;
height: number;
borderRadius: number;
className: string;
color: string;
shapeRendering: string;
strokeColor: string;
strokeWidth: number;
style?: CSSProperties;
onClick?: (event: MouseEvent, id: string) => void;
}