"use client";
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import { Dialog, DialogContent } from "../../components/ui/dialog";
import { StyledDialogTitle } from "../../components/ui/styled-dialog-title";
import { TreeSelector } from "./TreeSelector";
import { useEditContext } from "../client/editContext";
export const MediaSelector = ({ visible, onHide, onMediaSelected, selectedIdPath, mode, language, initialSearchTerm, }) => {
    const editContext = useEditContext();
    return (_jsx(Dialog, { open: visible, onOpenChange: (open) => !open && onHide(), children: _jsxs(DialogContent, { className: "flex flex-col overflow-hidden border-none p-0 shadow-2xl", style: {
                width: "94vw",
                maxWidth: "1400px",
                height: editContext?.isMobile ? "96dvh" : "90vh",
            }, "data-testid": "media-selector-dialog", children: [_jsx(StyledDialogTitle, { icon: mode === "video" ? (_jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 1, strokeLinecap: "round", strokeLinejoin: "round", children: [_jsx("rect", { width: "18", height: "18", x: "3", y: "3", rx: "2" }), _jsx("path", { d: "m10 8 5 4-5 4V8z" })] })) : (_jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 1, strokeLinecap: "round", strokeLinejoin: "round", children: [_jsx("rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", ry: "2" }), _jsx("circle", { cx: "9", cy: "9", r: "2" }), _jsx("path", { d: "m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21" })] })), title: mode === "video"
                        ? "Media Library - Video"
                        : "Media Library - Images" }), _jsx("div", { className: "flex h-full min-h-0 flex-1 flex-col overflow-hidden", children: _jsx(TreeSelector, { language: language, selectedIdPath: selectedIdPath, onHide: onHide, onMediaSelected: onMediaSelected, mode: mode === "video" ? "video" : "image", initialSearchTerm: initialSearchTerm }) })] }) }));
};
//# sourceMappingURL=MediaSelector.js.map