mirror of
https://github.com/Xevion/byte-me.git
synced 2025-12-05 23:14:31 -06:00
Add comprehensive bitrate data extraction and visualization capabilities: - Implement analyze_files command for file candidacy detection - Add extract_bitrate_data command using ffprobe - Create BitrateData, BitrateFrame, File, and FileCandidacy types with TS bindings - Update App to fetch and display bitrate data from dropped files - Refactor DropOverlay to use new file analysis system - Configure Graph component for packet size visualization - Simplify drag-drop flow to trigger on drop event only
24 lines
560 B
TypeScript
24 lines
560 B
TypeScript
import { useEffect, useState } from "react";
|
|
import { getCurrentWebview } from "@tauri-apps/api/webview";
|
|
|
|
export function useDragDropPaths(): string[] {
|
|
const [paths, setPaths] = useState<string[]>([]);
|
|
|
|
useEffect(() => {
|
|
const unlistenPromise = getCurrentWebview().onDragDropEvent(
|
|
async ({ payload }) => {
|
|
if (payload.type === "drop") {
|
|
setPaths(payload.paths);
|
|
} else if (payload.type === "leave") {
|
|
setPaths([]);
|
|
}
|
|
},
|
|
);
|
|
return () => {
|
|
unlistenPromise.then((unlisten) => unlisten());
|
|
};
|
|
}, []);
|
|
|
|
return paths;
|
|
}
|