<script>
	import { templates } from '$lib/templates/templates';

	/** @type number */ export let templateIndex;
	import { address } from '$lib/stores/store';
</script>

{#if templates[templateIndex] && $address}
	<div
		class="address"
		style="
    top: {templates[templateIndex].address.top}px;
    height: {templates[templateIndex].address.height}rem;
    left: {templates[templateIndex].address.left}rem;
    right: {templates[templateIndex].address.right}rem;
    color: {templates[templateIndex].address.color};
    font-size: {templates[templateIndex].address.fontSize}rem;
    font-family: {templates[templateIndex].address.fontFamily};
    line-height: {templates[templateIndex].address.lineHeight};
		text-align: {templates[templateIndex].address.textAlign};
		font-weight: {templates[templateIndex].address.fontWeight};
		line-height: {templates[templateIndex].address.lineHeight}rem;
    "
	>
		{$address}
	</div>
{/if}

<style>
	.address {
		position: absolute;
		display: grid;
		overflow: hidden;
		white-space: pre-wrap;
		align-items: center;
		justify-content: center;
	}
</style>
