import React from 'react';
import { useGraphicsContext } from '../GraphicsContext';
import { IconButton } from '../../IconButton/IconButton';
import { ChevronLeftIcon, ChevronRightIcon } from '../../../icons';
const ArrowUp = () => ;
const ArrowDown = () => ;
export const GPanArrows: React.FC = () => {
const { setPan } = useGraphicsContext();
const panAmount = 50;
const handlePan = (direction: 'left' | 'right' | 'up' | 'down') => {
setPan(prev => {
switch (direction) {
case 'left': return { ...prev, x: prev.x + panAmount };
case 'right': return { ...prev, x: prev.x - panAmount };
case 'up': return { ...prev, y: prev.y + panAmount };
case 'down': return { ...prev, y: prev.y - panAmount };
default: return prev;
}
});
};
const baseStyle: React.CSSProperties = {
position: 'absolute',
zIndex: 10,
transform: 'translate(-50%, -50%)',
};
return (
<>
handlePan('left')} style={{...baseStyle, left: '20px', top: '50%'}} />
handlePan('right')} style={{...baseStyle, right: '-10px', top: '50%'}} />
handlePan('up')} style={{...baseStyle, top: '20px', left: '50%'}} />
handlePan('down')} style={{...baseStyle, bottom: '0px', left: '50%'}} />
>
);
};