import styled from "@emotion/styled"; import { useSharedState } from "../../store/useSharedState"; import InputField from "../../ui/InputField"; import { capitalizeFirstLetter } from "../../utils/capitalizeFirstLetter"; const StyledPointsContainer = styled("div")({ display: "grid", gridTemplateColumns: "100px 1fr 1fr", gap: "0.5rem", alignItems: "center", }); function PhotoPointPosition({ index }) { const setSinglePointPosition = useSharedState( (state) => state.setSinglePointPosition ); const previewMode = useSharedState((state) => state.previewMode); const posX = useSharedState( (state) => state.points[index].positions[previewMode].x ); const posY = useSharedState( (state) => state.points[index].positions[previewMode].y ); const handleChangeNumber = ({ e, brName, positionName, min = 0, max = 100, }) => { let newValue = Number(e.target.value); if (newValue < min) newValue = min; if (newValue > max) newValue = max; setSinglePointPosition(index, brName, positionName, newValue); }; return (