import "../styles/EditingTools.css"; import { useEffect, useState } from "react"; interface EditingToolsProps { onSplit: () => void; onReset: () => void; onUndo: () => void; onRedo: () => void; onPlaySegments: () => void; onPlay: () => void; canUndo: boolean; canRedo: boolean; isPlaying?: boolean; isPlayingSegments?: boolean; } const EditingTools = ({ onSplit, onReset, onUndo, onRedo, onPlaySegments, onPlay, canUndo, canRedo, isPlaying = false, isPlayingSegments = false }: EditingToolsProps) => { const [isSmallScreen, setIsSmallScreen] = useState(false); useEffect(() => { const checkScreenSize = () => { setIsSmallScreen(window.innerWidth <= 640); }; checkScreenSize(); window.addEventListener("resize", checkScreenSize); return () => window.removeEventListener("resize", checkScreenSize); }, []); // Handle play button click with iOS fix const handlePlay = () => { // Ensure lastSeekedPosition is used when play is clicked if (typeof window !== "undefined") { console.log("Play button clicked, current lastSeekedPosition:", window.lastSeekedPosition); } // Call the original handler onPlay(); }; return (