summaryrefslogtreecommitdiff
path: root/packages/frontend/src/components/SkRemoteFollowersWarning.vue
blob: bc15dd40ba07a508f450d67c2802a12dfdf15a6b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<!--
SPDX-FileCopyrightText: hazelnoot and other Sharkey contributors
SPDX-License-Identifier: AGPL-3.0-only
-->

<template>
<MkInfo v-if="showRemoteWarning" warn closable @close="closeWarning">
	{{ i18n.ts.remoteFollowersWarning }}
</MkInfo>
</template>

<script setup lang="ts">
import { computed } from 'vue';
import type { FollowingFeedModel } from '@/utility/following-feed-utils.js';
import { i18n } from '@/i18n.js';
import MkInfo from '@/components/MkInfo.vue';
import { followersTab } from '@/utility/following-feed-utils.js';

const props = defineProps<{
	model: FollowingFeedModel,
}>();

// eslint-disable-next-line vue/no-setup-props-reactivity-loss
const { model: { userList, remoteWarningDismissed } } = props;

const showRemoteWarning = computed(
	() => userList.value === followersTab && !remoteWarningDismissed.value,
);

function closeWarning() {
	remoteWarningDismissed.value = true;
}
</script>