()
| 51 | ` |
| 52 | |
| 53 | const SoundBar = () => { |
| 54 | |
| 55 | const ref = useRef(null); |
| 56 | const [click, setClick] = useState(false); |
| 57 | |
| 58 | const handleClick = () => { |
| 59 | setClick(!click); |
| 60 | |
| 61 | if(!click){ |
| 62 | ref.current.play(); |
| 63 | }else{ |
| 64 | ref.current.pause(); |
| 65 | } |
| 66 | } |
| 67 | return ( |
| 68 | <Box onClick={() => handleClick()}> |
| 69 | <Line $click={click}/> |
| 70 | <Line $click={click}/> |
| 71 | <Line $click={click}/> |
| 72 | <Line $click={click}/> |
| 73 | <Line $click={click}/> |
| 74 | |
| 75 | |
| 76 | <audio src={music} ref={ref} loop /> |
| 77 | </Box> |
| 78 | ) |
| 79 | } |
| 80 | |
| 81 | export default SoundBar |
nothing calls this directly
no test coverage detected