import React, {useState} from "react"; import {CardTitle} from "@/components/ui/card.tsx"; import {ChevronDown, Folder} from "lucide-react"; import {Button} from "@/components/ui/button.tsx"; import {Host} from "@/ui/Desktop/Navigation/Hosts/Host.tsx"; import {Separator} from "@/components/ui/separator.tsx"; interface SSHHost { id: number; name: string; ip: string; port: number; username: string; folder: string; tags: string[]; pin: boolean; authType: string; password?: string; key?: string; keyPassword?: string; keyType?: string; enableTerminal: boolean; enableTunnel: boolean; enableFileManager: boolean; defaultPath: string; tunnelConnections: any[]; createdAt: string; updatedAt: string; } interface FolderCardProps { folderName: string; hosts: SSHHost[]; isFirst: boolean; isLast: boolean; } export function FolderCard({folderName, hosts, isFirst, isLast}: FolderCardProps): React.ReactElement { const [isExpanded, setIsExpanded] = useState(true); const toggleExpanded = () => { setIsExpanded(!isExpanded); }; return (
{folderName}
{isExpanded && (
{hosts.map((host, index) => ( {index < hosts.length - 1 && (
)}
))}
)}
) }