<script lang="ts">
	import type { Bezahlmethoden } from "@ibcornelsen/database/client";

	export let name: string;
	export let icon: string;
	export let paymentType: Bezahlmethoden;
	export let selectedPaymentType: Bezahlmethoden;
</script>

<button type="button" data-test={paymentType} class="flex flex-col items-center cursor-pointer" class:bg-gray-100={paymentType == selectedPaymentType} on:click={() => selectedPaymentType = paymentType}>
	<img src={icon} alt={name} />
	<span aria-label={name}>
		{name}
	</span>
</button>
