1
1
mirror of https://github.com/neosubhamoy/neodlp.git synced 2026-03-23 01:55:49 +05:30

refactor: migrated to react-resizable-panels v4

This commit is contained in:
2026-02-12 23:11:34 +05:30
Verified
parent 27031b05d8
commit 6afc8c4ada
5 changed files with 62 additions and 47 deletions

View File

@@ -10,6 +10,7 @@ import { PlaylistToggleGroup, PlaylistToggleGroupItem } from "@/components/custo
import { getMergedBestFormat } from "@/utils";
import { Switch } from "@/components/ui/switch";
import { FormatToggleGroup, FormatToggleGroupItem } from "@/components/custom/formatToggleGroup";
import { Layout } from "react-resizable-panels";
interface PlaylistPreviewSelectionProps {
videoMetadata: RawVideoInfo;
@@ -348,18 +349,22 @@ export function PlaylistDownloader({ videoMetadata, audioOnlyFormats, videoOnlyF
return (
<div className="flex">
<ResizablePanelGroup
direction="horizontal"
orientation="horizontal"
className="w-full"
onLayout={(sizes) => setPlaylistPanelSizes(sizes)}
onLayoutChanged={(layout: Layout) => {
const firstPanelSize = layout[Object.keys(layout)[0]];
const secondPanelSize = layout[Object.keys(layout)[1]];
setPlaylistPanelSizes([firstPanelSize, secondPanelSize]);
}}
>
<ResizablePanel
defaultSize={playlistPanelSizes[0]}
defaultSize={`${playlistPanelSizes[0]}%`}
>
<PlaylistPreviewSelection videoMetadata={videoMetadata} />
</ResizablePanel>
<ResizableHandle />
<ResizableHandle withHandle />
<ResizablePanel
defaultSize={playlistPanelSizes[1]}
defaultSize={`${playlistPanelSizes[1]}%`}
>
<div className="flex flex-col w-full pl-4">
<Tabs