2022-07-01 16:33:47 +02:00
|
|
|
<template>
|
|
|
|
<MkSpacer :content-max="800">
|
2022-07-03 07:43:28 +02:00
|
|
|
<MkTab v-model="tab" style="margin-bottom: var(--margin);">
|
2023-02-12 21:07:07 +01:00
|
|
|
<option value="local">{{ i18n.ts.local }}</option>
|
|
|
|
<option value="remote">{{ i18n.ts.remote }}</option>
|
2022-07-01 16:42:03 +02:00
|
|
|
</MkTab>
|
2023-02-12 21:07:07 +01:00
|
|
|
<XNotes v-if="tab === 'local'" :pagination="paginationForLocal"/>
|
|
|
|
<XNotes v-else-if="tab === 'remote'" :pagination="paginationForRemote"/>
|
2022-07-01 16:33:47 +02:00
|
|
|
</MkSpacer>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts" setup>
|
2022-08-30 17:24:33 +02:00
|
|
|
import XNotes from '@/components/MkNotes.vue';
|
|
|
|
import MkTab from '@/components/MkTab.vue';
|
2022-07-01 16:33:47 +02:00
|
|
|
import { i18n } from '@/i18n';
|
|
|
|
|
2023-02-12 21:07:07 +01:00
|
|
|
const paginationForLocal = {
|
2022-07-01 16:33:47 +02:00
|
|
|
endpoint: 'notes/featured' as const,
|
|
|
|
limit: 10,
|
2023-02-12 21:15:21 +01:00
|
|
|
origin: 'local',
|
2022-07-01 16:33:47 +02:00
|
|
|
offsetMode: true,
|
2023-04-07 07:48:07 +02:00
|
|
|
params: {
|
|
|
|
days: 14,
|
|
|
|
}
|
2022-07-01 16:33:47 +02:00
|
|
|
};
|
2022-07-01 16:42:03 +02:00
|
|
|
|
2023-02-12 21:07:07 +01:00
|
|
|
const paginationForRemote = {
|
|
|
|
endpoint: 'notes/featured' as const,
|
2023-02-13 00:38:19 +01:00
|
|
|
limit: 20,
|
2022-07-01 16:42:03 +02:00
|
|
|
offsetMode: true,
|
2023-02-12 21:40:47 +01:00
|
|
|
params: {
|
|
|
|
origin: 'remote',
|
2023-04-07 07:48:07 +02:00
|
|
|
days: 7,
|
2023-02-12 21:40:47 +01:00
|
|
|
}
|
2023-02-12 21:07:07 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
// const paginationForRemote = {
|
|
|
|
// endpoint: 'notes/polls/recommendation' as const,
|
|
|
|
// limit: 10,
|
|
|
|
// offsetMode: true,
|
|
|
|
// };
|
2022-07-01 16:42:03 +02:00
|
|
|
|
2023-02-12 21:15:21 +01:00
|
|
|
let tab = $ref('local');
|
2022-07-01 16:33:47 +02:00
|
|
|
</script>
|