<script lang="ts">
	import { goto } from '$app/navigation';

	function logout() {
		localStorage.removeItem('api_token');
		goto('/login');
	}
</script>

<div class="container mx-auto px-4 py-8 max-w-2xl">
	<h1 class="text-3xl font-bold text-base-content mb-8">Settings</h1>

	<div class="card bg-base-200 border border-base-300">
		<div class="card-body">
			<h2 class="card-title text-base-content">Session</h2>
			<p class="text-base-content/50 text-sm">Clear your API token and return to login.</p>
			<div class="card-actions justify-end mt-4">
				<button class="btn btn-error btn-outline" onclick={logout}>
					Disconnect
				</button>
			</div>
		</div>
	</div>
</div>
