import React from 'react';
import AppearanceToggleDropdown from '@/components/appearance-dropdown';
import { Button } from '@/components/ui/button';
import { useNavigate } from 'react-router-dom';

export default function SettingsPage() {
  const nav = useNavigate();
  function logout() {
    localStorage.removeItem('ta_token');
    nav('/admin/login', { replace: true });
  }
  return (
    <div className="mx-auto max-w-sm p-6">
      <h1 className="mb-4 text-lg font-semibold">Einstellungen</h1>
      <div className="mb-4">
        <div className="text-sm font-medium">Darstellung</div>
        <AppearanceToggleDropdown />
      </div>
      <Button variant="destructive" onClick={logout}>Abmelden</Button>
    </div>
  );
}

