2023-07-26 22:31:52 -07:00
|
|
|
<!--
|
|
|
|
SPDX-FileCopyrightText: syuilo and other misskey contributors
|
|
|
|
SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
-->
|
|
|
|
|
2020-01-29 11:37:25 -08:00
|
|
|
<template>
|
2022-06-20 01:38:49 -07:00
|
|
|
<MkStickyContainer>
|
2023-03-15 19:56:20 -07:00
|
|
|
<template #header><MkPageHeader v-model:tab="tab" :actions="headerActions" :tabs="headerTabs"/></template>
|
|
|
|
|
2024-01-18 01:21:33 -08:00
|
|
|
<MkHorizontalSwipe v-model:tab="tab" :tabs="headerTabs">
|
|
|
|
<MkSpacer v-if="tab === 'note'" key="note" :contentMax="800">
|
|
|
|
<div v-if="notesSearchAvailable">
|
|
|
|
<XNote/>
|
|
|
|
</div>
|
|
|
|
<div v-else>
|
|
|
|
<MkInfo warn>{{ i18n.ts.notesSearchNotAvailable }}</MkInfo>
|
|
|
|
</div>
|
|
|
|
</MkSpacer>
|
|
|
|
|
|
|
|
<MkSpacer v-else-if="tab === 'user'" key="user" :contentMax="800">
|
|
|
|
<XUser/>
|
|
|
|
</MkSpacer>
|
|
|
|
</MkHorizontalSwipe>
|
2022-06-20 01:38:49 -07:00
|
|
|
</MkStickyContainer>
|
2020-01-29 11:37:25 -08:00
|
|
|
</template>
|
|
|
|
|
2022-01-12 09:21:43 -08:00
|
|
|
<script lang="ts" setup>
|
2023-12-20 18:36:45 -08:00
|
|
|
import { computed, defineAsyncComponent, ref } from 'vue';
|
2023-09-19 00:37:43 -07:00
|
|
|
import { i18n } from '@/i18n.js';
|
|
|
|
import { definePageMetadata } from '@/scripts/page-metadata.js';
|
|
|
|
import { $i } from '@/account.js';
|
|
|
|
import { instance } from '@/instance.js';
|
2023-03-15 19:56:20 -07:00
|
|
|
import MkInfo from '@/components/MkInfo.vue';
|
2024-01-18 01:21:33 -08:00
|
|
|
import MkHorizontalSwipe from '@/components/MkHorizontalSwipe.vue';
|
2020-01-29 11:37:25 -08:00
|
|
|
|
2023-05-11 02:10:34 -07:00
|
|
|
const XNote = defineAsyncComponent(() => import('./search.note.vue'));
|
|
|
|
const XUser = defineAsyncComponent(() => import('./search.user.vue'));
|
2020-01-29 11:37:25 -08:00
|
|
|
|
2023-12-06 21:42:09 -08:00
|
|
|
const tab = ref('note');
|
2023-03-15 19:56:20 -07:00
|
|
|
|
|
|
|
const notesSearchAvailable = (($i == null && instance.policies.canSearchNotes) || ($i != null && $i.policies.canSearchNotes));
|
2023-02-24 16:01:21 -08:00
|
|
|
|
2023-12-06 21:42:09 -08:00
|
|
|
const headerActions = computed(() => []);
|
2022-06-20 01:38:49 -07:00
|
|
|
|
2023-12-06 21:42:09 -08:00
|
|
|
const headerTabs = computed(() => [{
|
2023-03-15 19:56:20 -07:00
|
|
|
key: 'note',
|
|
|
|
title: i18n.ts.notes,
|
|
|
|
icon: 'ti ti-pencil',
|
|
|
|
}, {
|
|
|
|
key: 'user',
|
|
|
|
title: i18n.ts.users,
|
|
|
|
icon: 'ti ti-users',
|
|
|
|
}]);
|
2022-06-20 01:38:49 -07:00
|
|
|
|
|
|
|
definePageMetadata(computed(() => ({
|
2023-05-11 02:10:34 -07:00
|
|
|
title: i18n.ts.search,
|
2022-12-19 02:01:30 -08:00
|
|
|
icon: 'ti ti-search',
|
2022-06-20 01:38:49 -07:00
|
|
|
})));
|
2020-01-29 11:37:25 -08:00
|
|
|
</script>
|