<script>
	let {
		style = 'default',
		color = 'black',
		onclick,
		children,
		disabled = false,
		fill = false
	} = $props();
</script>

<button {disabled} class="btn {style} {color}" class:fill {onclick} class:disabled
	>{@render children()}</button
>

<style>
	.btn {
		font-family: var(--font);
		outline: unset;
		border: unset;
		padding: 0.5rem 1rem;
		border-radius: 5px;
		font-size: 1rem;
		font-weight: 100;
		cursor: pointer;
	}
	.black {
		color: var(--light);
		background-color: var(--black);
	}
	.black:hover {
		background-color: var(--accent);
	}
	.black:active {
		background-color: var(--light-accent);
	}

	.iconbutton {
		background-color: transparent;
		padding: 0;
		margin: 0;
	}
	.iconbutton:hover {
		background-color: var(--light);
	}

	.accent {
		color: var(--light);
		background-color: var(--accent);
	}
	.accent:hover {
		background-color: var(--light-accent);
	}
	.accent:active {
		background-color: var(--dark-accent);
	}
	.disabled {
		opacity: 0.5;
		cursor: default;
		pointer-events: none;
	}
	.fill {
		width: 100%;
		height: 100%;
	}
</style>
