import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import { useState } from "react";
import { ChevronDown, } from "lucide-react";
import { Popover, PopoverContent, PopoverTrigger, } from "../../components/ui/popover";
import { ProjectListContent } from "./ProjectListContent";
export function ProjectSelector({ nav }) {
    const [projectPopoverOpen, setProjectPopoverOpen] = useState(false);
    return (_jsxs(Popover, { open: projectPopoverOpen, onOpenChange: setProjectPopoverOpen, children: [_jsx(PopoverTrigger, { asChild: true, children: _jsxs("button", { type: "button", "data-testid": "taskboard-project-selector-trigger", className: "group flex min-w-0 items-center gap-2 rounded-md px-2 py-1 text-left hover:bg-slate-100/70", title: "Select project", children: [_jsxs("div", { className: "min-w-0", children: [_jsx("div", { className: "truncate text-sm font-semibold text-slate-900", children: nav.projectTitle }), _jsxs("div", { className: "mt-0.5 flex items-center gap-2", children: [nav.selectedProjectId && (_jsx("div", { className: "h-1.5 w-1.5 shrink-0 rounded-full bg-green-500" })), _jsx("span", { className: "truncate text-[11px] text-slate-500", children: nav.projectSubtitle }), nav.selectedProjectId && (_jsx("span", { className: "shrink-0 truncate text-[10px] font-semibold tracking-wider text-slate-400 uppercase", children: nav.permissionLabel }))] })] }), _jsx(ChevronDown, { className: "h-4 w-4 shrink-0 text-slate-500 group-hover:text-slate-700" })] }) }), _jsx(PopoverContent, { align: "start", sideOffset: 8, className: "w-[calc(100vw-2rem)] max-w-[560px] p-0", "data-testid": "taskboard-project-popover", children: _jsx(ProjectListContent, { nav: nav, onProjectSelected: () => setProjectPopoverOpen(false) }) })] }));
}
//# sourceMappingURL=ProjectSelector.js.map