<script lang="ts">
	import UserIcon from "~icons/solar/user-broken";
	import type { CustomerInfoModel } from "../data";
	import CInfoCard from "./cinfo-card.svelte";

	let {
		customerInfo,
	}: {
		customerInfo: CustomerInfoModel;
	} = $props();
</script>

<CInfoCard icon={UserIcon} title="Customer Information">
	<div class="grid grid-cols-1 gap-4 md:grid-cols-2">
		<div>
			<span class="text-xs text-gray-500">Full Name</span>
			<p>
				{customerInfo.firstName}
				{#if customerInfo.middleName}
					{customerInfo.middleName}
				{/if}
				{customerInfo.lastName}
			</p>
		</div>
		<div>
			<span class="text-xs text-gray-500">Email</span>
			<p>{customerInfo.email}</p>
		</div>
		<div>
			<span class="text-xs text-gray-500">Phone Number</span>
			<p>{customerInfo.phoneCountryCode} {customerInfo.phoneNumber}</p>
		</div>
		<div>
			<span class="text-xs text-gray-500">City</span>
			<p>{customerInfo.city}</p>
		</div>
		<div>
			<span class="text-xs text-gray-500">State</span>
			<p>{customerInfo.state}</p>
		</div>
		<div>
			<span class="text-xs text-gray-500">Country</span>
			<p>{customerInfo.country}</p>
		</div>
		<div>
			<span class="text-xs text-gray-500">Zip Code</span>
			<p>{customerInfo.zipCode}</p>
		</div>
		<div class="md:col-span-2">
			<span class="text-xs text-gray-500">Address</span>
			<p>{customerInfo.address}</p>
			{#if customerInfo.address2}
				<p class="text-sm text-gray-600">{customerInfo.address2}</p>
			{/if}
		</div>
	</div>
</CInfoCard>
