import { useEffect, useState } from "react"; import { useAppContext } from "../../contexts/AppContext"; import { Canvas } from "../../lib/canvas"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { faXmark } from "@fortawesome/free-solid-svg-icons"; import { KeybindManager } from "../../lib/keybinds"; import { Button, Link } from "@nextui-org/react"; export const Palette = () => { const { config, user, cursor, setCursor } = useAppContext(); useEffect(() => { Canvas.instance?.updateCursor(cursor.color); }, [cursor]); useEffect(() => { const handleDeselect = () => { setCursor((v) => ({ ...v, color: undefined, })); }; KeybindManager.addListener("DESELECT_COLOR", handleDeselect); return () => { KeybindManager.removeListener("DESELECT_COLOR", handleDeselect); }; }, []); return (
{config.pallete.colors.map((color) => ( ))}
{!user && (
{import.meta.env.VITE_INCLUDE_EVENT_INFO ? ( <>The event hasn't started yet ) : ( <> You are not logged in )}
)}
); };