Files
classroomio/src/lib/components/Vote/index.svelte
T

29 lines
604 B
Svelte
Raw Normal View History

2021-05-06 07:15:40 +03:00
<script>
import ArrowUpIcon from 'carbon-icons-svelte/lib/ArrowUp.svelte';
2021-07-22 08:04:48 +03:00
import Chip from '../Chip/index.svelte';
2021-05-06 07:15:40 +03:00
export let value = 0;
2023-05-20 23:53:28 +00:00
export let upVote = () => {};
export let disabled = false;
2021-05-06 07:15:40 +03:00
</script>
<button
2023-05-20 23:53:28 +00:00
class="vote border-none {disabled ? 'cursor-not-allowed' : 'cursor-pointer'}"
on:click={disabled ? undefined : upVote}
>
<ArrowUpIcon size={16} />
2021-05-06 07:15:40 +03:00
<Chip {value} />
</button>
2021-05-06 07:15:40 +03:00
<style>
.vote {
display: flex;
flex-direction: column;
align-items: center;
min-width: 25px;
width: 25px;
justify-content: center;
margin-right: 10px;
}
</style>