import React, { useState } from 'react';
import { NavLink, Outlet } from 'react-router-dom';
import { useUIStore } from '@/store/uiStore';
import { ChevronRight, ChevronDown, Zap, Play, History, GitBranch, Settings2, Activity, Clock, ArrowLeft } from 'lucide-react';
interface AutomationNode {
title: string;
path?: string;
icon?: React.ReactNode;
children?: AutomationNode[];
}
const AUTOMATION_TREE: AutomationNode[] = [
{
title: 'Automation',
icon: ,
children: [
{ title: 'Übersicht', path: '/automation/overview' },
{ title: 'Ausführungen', path: '/automation/runs' },
{ title: 'Versionen', path: '/automation/versions' },
],
},
{
title: 'Einstellungen',
icon: ,
children: [
{ title: 'Trigger', path: '/automation/triggers' },
{ title: 'Aktionen', path: '/automation/actions' },
{ title: 'Bedingungen', path: '/automation/conditions' },
],
},
];
function TreeItem({ node, depth }: { node: AutomationNode; depth: number }) {
const [expanded, setExpanded] = useState(depth < 1);
const hasChildren = node.children && node.children.length > 0;
const paddingLeft = depth * 16 + 12;
if (hasChildren) {
return (
{expanded && (
{node.children!.map((child) => (
))}
)}
);
}
return (
`flex items-center gap-2 px-3 py-2 rounded-lg text-sm transition-colors min-h-touch ${
isActive
? 'bg-primary-100 text-primary-700 font-medium'
: 'text-secondary-600 hover:bg-secondary-100 hover:text-secondary-900'
}`
}
style={{ paddingLeft: paddingLeft + 20 }}
>
{node.icon}
{node.title}
);
}
export function AutomationPage() {
const sidebarOpen = useUIStore((state) => state.sidebarOpen);
return (
);
}