2022-08-08 17:24:18 +00:00
|
|
|
<template>
|
|
|
|
<div :class="['player__row', { 'player__row__idle': player.isIdle }]">
|
|
|
|
<div class="player__status">
|
2022-08-31 08:57:25 +00:00
|
|
|
<span v-if="showCheckbox">{{ checked ? '☑' : '☐' }}</span>
|
2022-08-08 17:24:18 +00:00
|
|
|
</div>
|
|
|
|
<div class="player__name">
|
|
|
|
{{ player.name }}
|
|
|
|
</div>
|
2022-08-31 08:57:25 +00:00
|
|
|
<div v-if="showScore" class="player__score">
|
2022-08-08 17:24:18 +00:00
|
|
|
{{ player.score || 0 }}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script setup lang="ts">
|
2022-08-31 08:57:25 +00:00
|
|
|
import { Player } from '@/composables/engine.d';
|
2022-08-08 17:24:18 +00:00
|
|
|
|
|
|
|
defineProps<{
|
|
|
|
player: Player,
|
2022-08-31 08:57:25 +00:00
|
|
|
showScore?: boolean,
|
|
|
|
showCheckbox?: boolean,
|
|
|
|
checked?: boolean,
|
2022-08-08 17:24:18 +00:00
|
|
|
}>()
|
|
|
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss">
|
|
|
|
@import '~/assets/css/components';
|
|
|
|
|
|
|
|
.player {
|
|
|
|
&__row {
|
|
|
|
display: flex;
|
|
|
|
background-color: $box-primary-background-color;
|
|
|
|
color: $box-primary-text-color;
|
|
|
|
font-family: $font-secondary;
|
|
|
|
font-size: 18px;
|
|
|
|
|
|
|
|
&__idle {
|
|
|
|
background-color: $box-primary-disabled-background-color;
|
|
|
|
color: $box-primary-disabled-text-color;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
&__name {
|
|
|
|
display: inline;
|
|
|
|
flex-grow: 1;
|
|
|
|
white-space: nowrap;
|
|
|
|
overflow: hidden;
|
|
|
|
text-overflow: ellipsis;
|
|
|
|
}
|
|
|
|
|
|
|
|
&__status {
|
|
|
|
width: 20px;
|
|
|
|
}
|
|
|
|
|
|
|
|
&__score {
|
|
|
|
width: 32px;
|
|
|
|
margin-left: 16px;
|
|
|
|
text-align: right;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</style>
|