<script lang="ts">
	let { name, children } : {name: string, children?: any} = $props();
</script>

<div class="window">
	<div class="title">
		<h2>{name}</h2>
		<div class="minimise noselect">_</div>
	</div>
	<div class="content">
		{#if children}
			{@render children?.()}
		{:else}
			<p>meoww :3</p>
		{/if}
	</div>
</div>

<style lang="scss">
	@use '$lib/styles/variables' as vars;
	h2 {
		color: black;
		line-height: 32px;
	}
	.title {
		font-family: easvhsregular;
		h2 {
			margin-top: 8px;
			font-size: 2em;
		}
		display: flex;
		justify-content: space-between;
		align-items: center;
		background: vars.$base-colour;
		// background: linear-gradient(1deg,vars.$base-colour 35%, vars.$highlight 100%);
		padding: 0 2px 0 1em;
		gap: 1em;
	}
	.content {
		border: 1px solid vars.$base-colour;
		padding: 1em;
		background-color: black;
	}
	.minimise {
		color: black;
		background-color: vars.$base-colour;
		border: 2px solid #53461f;
		box-sizing: border-box;
		line-height: 32px;
		height: 32px;
		width: 32px;
		text-align: center;
		margin-right: .4em;
	}
	.minimise:hover {
		background-color: #ac9b38;
		cursor: pointer;
	}
</style>
