import { addImage, addText } from "@/store/app.slice"; import { Button } from "../ui/button"; import { Input } from "../ui/input"; import { useAppDispatch } from "@/hooks"; import { ChangeEvent, useState } from "react"; export function Sidebar() { const dispatch = useAppDispatch(); const [inputText, setInputText] = useState(""); const handleImageUploaded = (e: ChangeEvent) => { dispatch(addImage(e)); }; const handleInputChange = (e: ChangeEvent) => { setInputText(e.target.value); }; console.log(inputText); const handleTextAdd = () => dispatch(addText({initialValue: inputText})); return (
); }