refactor: add bot indicator icon

zio/stable
三咲智子 2023-01-07 21:53:09 +08:00
parent 6944a74653
commit bbc1580010
No known key found for this signature in database
GPG Key ID: 69992F2250DFD93E
2 changed files with 18 additions and 3 deletions

View File

@ -1,5 +1,20 @@
<script setup lang="ts">
defineProps<{
showLabel?: boolean
}>()
</script>
<template> <template>
<div flex="~" items-center border="~ base" text-secondary-light rounded-md px-1 text-xs my-auto> <div
flex="~ gap1" items-center
:class="{ 'border border-base rounded-md px-1': showLabel }"
text-secondary-light text-xs
>
<CommonTooltip :content="$t('account.bot')" :disabled="showLabel">
<div i-ri:robot-line />
</CommonTooltip>
<div v-if="showLabel">
{{ $t('account.bot') }} {{ $t('account.bot') }}
</div> </div>
</div>
</template> </template>

View File

@ -76,7 +76,7 @@ const isSelf = $computed(() => currentUser.value?.account.id === account.id)
<div flex="~ col gap1"> <div flex="~ col gap1">
<div flex justify-between> <div flex justify-between>
<AccountDisplayName :account="account" font-bold sm:text-2xl text-xl /> <AccountDisplayName :account="account" font-bold sm:text-2xl text-xl />
<AccountBotIndicator v-if="account.bot" /> <AccountBotIndicator v-if="account.bot" show-label />
</div> </div>
<AccountHandle :account="account" /> <AccountHandle :account="account" />
</div> </div>