<script lang="ts">
import { m } from '$lib/paraglide/messages.js';
import PersonalInfoForm from './PersonalInfoForm.svelte';
import PasswordChangeForm from './PasswordChangeForm.svelte';

let { data, form } = $props();
</script>

<div class="mx-auto max-w-7xl px-4 py-8 sm:px-6 lg:px-8">
	<!-- Back link -->
	<a
		href="/"
		class="group mb-4 inline-flex items-center text-xs font-bold tracking-widest text-ink-2 uppercase transition-colors hover:text-ink"
	>
		<svg
			class="mr-2 h-4 w-4 transform transition-transform group-hover:-translate-x-1"
			fill="none"
			viewBox="0 0 24 24"
			stroke="currentColor"
			stroke-width="2"
		>
			<path stroke-linecap="round" stroke-linejoin="round" d="M15 19l-7-7 7-7" />
		</svg>
		{m.btn_back_to_overview()}
	</a>

	<h1 class="mb-6 font-serif text-3xl font-bold text-ink">{m.profile_heading()}</h1>

	<div class="grid grid-cols-1 gap-6 md:grid-cols-2">
		<PersonalInfoForm user={data.user} form={form} />
		<PasswordChangeForm form={form} />
	</div>
</div>
