import { Box, Input } from "@chakra-ui/react"; import React, { useRef, useState } from "react"; import audioClick from "../assets/click-151673.mp3"; const DummyComponent = () => { // Define the state for the checkbox const [isSwitchOn, setIsSwitchOn] = useState(false); const audio = useRef(); // Function to toggle the switch const handleToggle = () => { setIsSwitchOn(!isSwitchOn); if(audio.current){ audio.current.play(); } }; return ( ); }; export default DummyComponent;