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 { Separator } from "@/components/ui/separator.tsx"; import { Host } from "@/ui/mobile/apps/navigation/hosts/Host.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: Array<{ sourcePort: number; endpointPort: number; endpointHost: string; maxRetries: number; retryInterval: number; autoStart: boolean; }>; createdAt: string; updatedAt: string; } interface FolderCardProps { folderName: string; hosts: SSHHost[]; onHostConnect: () => void; } export function FolderCard({ folderName, hosts, onHostConnect, }: FolderCardProps): React.ReactElement { const [isExpanded, setIsExpanded] = useState(true); const toggleExpanded = () => { setIsExpanded(!isExpanded); }; return (
{folderName}
{isExpanded && (
{hosts.map((host, index) => ( {index < hosts.length - 1 && (
)}
))}
)}
); }