updated visualization panel ui and added outer click
This commit is contained in:
@@ -5,7 +5,7 @@ interface SimpleCardProps {
|
||||
icon: React.ComponentType<React.SVGProps<SVGSVGElement>>; // React component for SVG icon
|
||||
value: string;
|
||||
per: string; // Percentage change
|
||||
position?: [number, number]
|
||||
position?: [number, number];
|
||||
}
|
||||
|
||||
const SimpleCard: React.FC<SimpleCardProps> = ({
|
||||
@@ -15,7 +15,6 @@ const SimpleCard: React.FC<SimpleCardProps> = ({
|
||||
per,
|
||||
position = [0, 0],
|
||||
}) => {
|
||||
|
||||
const handleDragStart = (event: React.DragEvent<HTMLDivElement>) => {
|
||||
const rect = event.currentTarget.getBoundingClientRect(); // Get position
|
||||
const cardData = JSON.stringify({
|
||||
@@ -23,7 +22,7 @@ const SimpleCard: React.FC<SimpleCardProps> = ({
|
||||
value,
|
||||
per,
|
||||
icon: Icon,
|
||||
|
||||
|
||||
className: event.currentTarget.className,
|
||||
position: [rect.top, rect.left], // ✅ Store position
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user