<script lang="ts">
	import type { CleanMemberProfile } from '$lib/APITypes'
	import { cleanId, toRomanNumerals } from '$lib/utils'

	export let data: CleanMemberProfile
</script>

<p class="unique-minions-text">
	Unique minions:
	<span class="minions-fraction">
		<b>{data.profile.minion_count}</b>/{data.profile.maxUniqueMinions}
	</span>
</p>
<table>
	{#each data.profile.minions as minion}
		<tr>
			<th>{cleanId(minion.name)}</th>
			{#each minion.levels as unlocked, i}
				<td class="minions-table" class:unlocked>
					{toRomanNumerals(i)}
				</td>
			{/each}
		</tr>
	{/each}
</table>

<style>
	.unique-minions-text {
		color: var(--theme-darker-text);
	}
	.minions-fraction {
		color: var(--theme-main-text);
	}
	.minions-table:not(.unlocked) {
		opacity: 0.2;
	}
	.minions-table.unlocked {
		color: #3e3;
	}
</style>
