import { Box, Flex } from "@chakra-ui/react"; import { Trans } from "@lingui/macro"; import WeaponImage from "components/common/WeaponImage"; import { weapons } from "lib/lists/weapons"; import { useMyTheme } from "lib/useMyTheme"; import Image from "next/image"; import { useState } from "react"; import Draggable from "react-draggable"; interface DraggableImageAdderProps { addImageToSketch: (imgSrc: string) => void; } const DraggableImageAdder: React.FC = ({ addImageToSketch, }) => { const { bgColor } = useMyTheme(); const [activeDrags, setActiveDrags] = useState(0); const onStart = () => { setActiveDrags(activeDrags + 1); }; const onStop = () => { setActiveDrags(activeDrags - 1); }; return (
Add image
{weapons.map((wpn) => ( addImageToSketch(`/weapons/${wpn.replace(".", "")}.png`) } m="3px" > ))} {["Blaster", "Brella", "Charger", "Slosher"].map( (grizzcoWeaponClass) => { const imgSrc = `/weapons/Grizzco ${grizzcoWeaponClass}.png`; return ( addImageToSketch(imgSrc)} src={imgSrc} width={32} height={32} /> ); } )} {["TC", "RM", "CB"].map((mode) => { const imgSrc = `/modes/${mode}.png`; return ( addImageToSketch(imgSrc)} src={imgSrc} width={32} height={32} /> ); })} {[ "Drizzler", "Flyfish", "Goldie", "Griller", "Maws", "Scrapper", "Steel Eal", "Steelhead", "Stinger", "Golden Egg", ].map((boss) => { const imgSrc = `/images/salmonRunIcons/${boss}.png`; return ( addImageToSketch(imgSrc)} src={imgSrc} width={32} height={32} /> ); })}
); }; export default DraggableImageAdder;