aboutsummaryrefslogtreecommitdiff
path: root/src/components/IconButton.vue
blob: 9357e9742af47876476706f8ae16eb3829bc19dd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<template>
<div :style="styles" class="p-2 rounded-full hover:cursor-pointer"
	:class="{'hover:brightness-125': !disabled, 'brightness-50': disabled}">
	<slot class="w-full h-full">?</slot>
</div>
</template>

<script setup lang="ts">
import {computed} from 'vue';

const props = defineProps({
	size: {type: Number, default: 36},
	disabled: {type: Boolean, default: false},
});

const styles = computed(() => ({
	minWidth: props.size + 'px',
	maxWidth: props.size + 'px',
	minHeight: props.size + 'px',
	maxHeight: props.size + 'px',
	padding: (props.size / 5) + 'px',
}));
</script>