import { Component, For } from "solid-js"; import { Handlers, PiecesStyle } from "../../types"; import Scrollable from "./reusable/Scrollable"; import piecesSets from "../../board/styles-pieces"; import { state, setState } from "../../state"; import "./Pieces.css"; const pieces = Object.entries(piecesSets).map(([key, data]) => ({ key, img: data.nw, })) as { key: PiecesStyle; img: string }[]; const Pieces: Component<{ handlers: Handlers; class?: string }> = (props) => { return ( { {(item) => ( { setState("boardConfig", "piecesStyle", item.key); props.handlers.changePiecesStyle(item.key); }} src={item.img} title={item.key} draggable={false} /> )} } ); }; export default Pieces;