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