2022-11-13 06:34:43 +01:00
|
|
|
<script setup lang="ts">
|
2023-01-08 07:21:09 +01:00
|
|
|
import type { mastodon } from 'masto'
|
2022-11-13 06:34:43 +01:00
|
|
|
|
2022-12-01 07:46:26 +01:00
|
|
|
const props = defineProps<{
|
2023-01-08 07:21:09 +01:00
|
|
|
status: mastodon.v1.Status
|
2022-11-28 11:23:33 +01:00
|
|
|
details?: boolean
|
2022-11-29 09:15:05 +01:00
|
|
|
command?: boolean
|
2022-11-13 06:34:43 +01:00
|
|
|
}>()
|
2022-11-15 13:08:49 +01:00
|
|
|
|
2022-12-14 18:20:03 +01:00
|
|
|
const focusEditor = inject<typeof noop>('focus-editor', noop)
|
2022-12-14 17:45:46 +01:00
|
|
|
|
2022-12-01 07:46:26 +01:00
|
|
|
const { details, command } = $(props)
|
2022-11-24 09:34:05 +01:00
|
|
|
|
2022-12-01 07:46:26 +01:00
|
|
|
const {
|
|
|
|
status,
|
|
|
|
isLoading,
|
2023-01-08 14:24:59 +01:00
|
|
|
canReblog,
|
2022-12-01 07:46:26 +01:00
|
|
|
toggleBookmark,
|
|
|
|
toggleFavourite,
|
|
|
|
toggleReblog,
|
|
|
|
} = $(useStatusActions(props))
|
2022-11-24 12:35:26 +01:00
|
|
|
|
2022-11-28 11:23:33 +01:00
|
|
|
const reply = () => {
|
2022-12-02 03:18:57 +01:00
|
|
|
if (!checkLogin())
|
|
|
|
return
|
2023-01-07 08:55:07 +01:00
|
|
|
if (details)
|
2022-12-14 18:20:03 +01:00
|
|
|
focusEditor()
|
2023-01-07 08:55:07 +01:00
|
|
|
else
|
2023-01-07 23:18:15 +01:00
|
|
|
navigateToStatus({ status, focusReply: true })
|
2022-11-24 12:35:26 +01:00
|
|
|
}
|
2022-11-13 06:34:43 +01:00
|
|
|
</script>
|
|
|
|
|
|
|
|
<template>
|
2022-11-25 08:49:43 +01:00
|
|
|
<div flex justify-between>
|
2022-11-27 16:11:34 +01:00
|
|
|
<div flex-1>
|
2022-11-26 00:46:25 +01:00
|
|
|
<StatusActionButton
|
2022-11-30 00:25:29 +01:00
|
|
|
:content="$t('action.reply')"
|
2022-12-13 21:01:04 +01:00
|
|
|
:text="status.repliesCount || ''"
|
2022-11-26 00:46:25 +01:00
|
|
|
color="text-blue" hover="text-blue" group-hover="bg-blue/10"
|
2023-01-08 10:03:23 +01:00
|
|
|
icon="i-ri:chat-1-line"
|
2022-11-29 09:15:05 +01:00
|
|
|
:command="command"
|
2022-11-28 11:23:33 +01:00
|
|
|
@click="reply"
|
2023-01-01 22:45:46 +01:00
|
|
|
>
|
|
|
|
<template v-if="status.repliesCount" #text>
|
2023-01-09 12:24:26 +01:00
|
|
|
<CommonLocalizedNumber
|
|
|
|
keypath="action.reply_count"
|
|
|
|
:count="status.repliesCount"
|
|
|
|
/>
|
2023-01-01 22:45:46 +01:00
|
|
|
</template>
|
|
|
|
</StatusActionButton>
|
2022-11-27 16:11:34 +01:00
|
|
|
</div>
|
2022-11-24 09:34:05 +01:00
|
|
|
|
2022-11-27 16:11:34 +01:00
|
|
|
<div flex-1>
|
2022-11-24 09:34:05 +01:00
|
|
|
<StatusActionButton
|
2022-11-30 00:25:29 +01:00
|
|
|
:content="$t('action.boost')"
|
2023-01-10 15:45:17 +01:00
|
|
|
:text="!getWellnessSetting('hideBoostCount') && status.reblogsCount ? status.reblogsCount : ''"
|
2022-11-24 09:34:05 +01:00
|
|
|
color="text-green" hover="text-green" group-hover="bg-green/10"
|
|
|
|
icon="i-ri:repeat-line"
|
|
|
|
active-icon="i-ri:repeat-fill"
|
2023-01-05 17:48:20 +01:00
|
|
|
:active="!!status.reblogged"
|
2023-01-08 14:24:59 +01:00
|
|
|
:disabled="isLoading.reblogged || !canReblog"
|
2022-11-29 09:15:05 +01:00
|
|
|
:command="command"
|
2022-11-24 09:34:05 +01:00
|
|
|
@click="toggleReblog()"
|
2023-01-01 22:45:46 +01:00
|
|
|
>
|
2023-01-10 15:45:17 +01:00
|
|
|
<template v-if="status.reblogsCount && !getWellnessSetting('hideBoostCount')" #text>
|
2023-01-09 12:24:26 +01:00
|
|
|
<CommonLocalizedNumber
|
|
|
|
keypath="action.boost_count"
|
|
|
|
:count="status.reblogsCount"
|
|
|
|
/>
|
2023-01-01 22:45:46 +01:00
|
|
|
</template>
|
|
|
|
</StatusActionButton>
|
2022-11-27 16:11:34 +01:00
|
|
|
</div>
|
2022-11-24 09:34:05 +01:00
|
|
|
|
2022-11-27 16:11:34 +01:00
|
|
|
<div flex-1>
|
2022-11-24 09:34:05 +01:00
|
|
|
<StatusActionButton
|
2022-11-30 00:25:29 +01:00
|
|
|
:content="$t('action.favourite')"
|
2023-01-10 15:45:17 +01:00
|
|
|
:text="!getWellnessSetting('hideFavoriteCount') && status.favouritesCount ? status.favouritesCount : ''"
|
2022-11-24 09:34:05 +01:00
|
|
|
color="text-rose" hover="text-rose" group-hover="bg-rose/10"
|
|
|
|
icon="i-ri:heart-3-line"
|
|
|
|
active-icon="i-ri:heart-3-fill"
|
2023-01-05 17:48:20 +01:00
|
|
|
:active="!!status.favourited"
|
2022-11-24 09:34:05 +01:00
|
|
|
:disabled="isLoading.favourited"
|
2022-11-29 09:15:05 +01:00
|
|
|
:command="command"
|
2022-11-24 09:34:05 +01:00
|
|
|
@click="toggleFavourite()"
|
2023-01-01 22:45:46 +01:00
|
|
|
>
|
2023-01-10 15:45:17 +01:00
|
|
|
<template v-if="status.favouritesCount && !getWellnessSetting('hideFavoriteCount')" #text>
|
2023-01-09 12:24:26 +01:00
|
|
|
<CommonLocalizedNumber
|
|
|
|
keypath="action.favourite_count"
|
|
|
|
:count="status.favouritesCount"
|
|
|
|
/>
|
2023-01-01 22:45:46 +01:00
|
|
|
</template>
|
|
|
|
</StatusActionButton>
|
2022-11-27 16:11:34 +01:00
|
|
|
</div>
|
2022-11-24 09:34:05 +01:00
|
|
|
|
2022-11-27 16:11:34 +01:00
|
|
|
<div flex-none>
|
2022-11-24 06:04:20 +01:00
|
|
|
<StatusActionButton
|
2022-11-30 00:25:29 +01:00
|
|
|
:content="$t('action.bookmark')"
|
2022-11-24 09:34:05 +01:00
|
|
|
color="text-yellow" hover="text-yellow" group-hover="bg-yellow/10"
|
|
|
|
icon="i-ri:bookmark-line"
|
|
|
|
active-icon="i-ri:bookmark-fill"
|
2023-01-05 17:48:20 +01:00
|
|
|
:active="!!status.bookmarked"
|
2022-11-24 09:34:05 +01:00
|
|
|
:disabled="isLoading.bookmarked"
|
2022-11-29 09:15:05 +01:00
|
|
|
:command="command"
|
2022-11-24 09:34:05 +01:00
|
|
|
@click="toggleBookmark()"
|
2022-11-24 06:04:20 +01:00
|
|
|
/>
|
2022-11-27 16:11:34 +01:00
|
|
|
</div>
|
2022-11-13 06:34:43 +01:00
|
|
|
</div>
|
|
|
|
</template>
|