import { Component, createSignal, onMount, Show } from 'solid-js';
import RulesList from './components/RulesList';
import CommandQueue from './components/CommandQueue';
import Login from './components/Login';
import ChangePassword from './components/ChangePassword';
import RequestLog from './components/RequestLog';
import { authStore } from './api/auth';
const App: Component = () => {
const [activeTab, setActiveTab] = createSignal<'rules' | 'commands' | 'logs'>('rules');
const [isAuthenticated, setIsAuthenticated] = createSignal(false);
const [showChangePassword, setShowChangePassword] = createSignal(false);
onMount(() => {
// Check if user is already authenticated
setIsAuthenticated(authStore.isAuthenticated());
});
const handleLoginSuccess = (token: string) => {
authStore.setToken(token);
setIsAuthenticated(true);
};
const handleLogout = () => {
authStore.clearToken();
setIsAuthenticated(false);
};
return (