2020-01-29 20:37:25 +01:00
|
|
|
<template>
|
2023-04-08 02:01:42 +02:00
|
|
|
<MkStickyContainer>
|
|
|
|
<template #header>
|
|
|
|
<MkTab v-model="include" :class="$style.tab">
|
|
|
|
<option :value="null">{{ i18n.ts.notes }}</option>
|
|
|
|
<option value="replies">{{ i18n.ts.notesAndReplies }}</option>
|
|
|
|
<option value="files">{{ i18n.ts.withFiles }}</option>
|
|
|
|
</MkTab>
|
|
|
|
</template>
|
|
|
|
<XNotes :no-gap="true" :pagination="pagination" />
|
|
|
|
</MkStickyContainer>
|
2020-01-29 20:37:25 +01:00
|
|
|
</template>
|
|
|
|
|
2022-01-09 13:35:35 +01:00
|
|
|
<script lang="ts" setup>
|
2023-09-02 01:27:33 +02:00
|
|
|
import { computed, ref } from "vue";
|
2023-09-24 06:27:16 +02:00
|
|
|
import type * as firefish from "firefish-js";
|
2023-04-08 02:01:42 +02:00
|
|
|
import XNotes from "@/components/MkNotes.vue";
|
|
|
|
import MkTab from "@/components/MkTab.vue";
|
|
|
|
import { i18n } from "@/i18n";
|
2020-01-29 20:37:25 +01:00
|
|
|
|
2022-01-09 13:35:35 +01:00
|
|
|
const props = defineProps<{
|
2023-09-24 06:27:16 +02:00
|
|
|
user: firefish.entities.UserDetailed;
|
2022-01-09 13:35:35 +01:00
|
|
|
}>();
|
2020-01-29 20:37:25 +01:00
|
|
|
|
2022-01-09 13:35:35 +01:00
|
|
|
const include = ref<string | null>(null);
|
2020-01-29 20:37:25 +01:00
|
|
|
|
2022-01-09 13:35:35 +01:00
|
|
|
const pagination = {
|
2023-04-08 02:01:42 +02:00
|
|
|
endpoint: "users/notes" as const,
|
2022-01-09 13:35:35 +01:00
|
|
|
limit: 10,
|
|
|
|
params: computed(() => ({
|
|
|
|
userId: props.user.id,
|
2023-04-08 02:01:42 +02:00
|
|
|
includeReplies: include.value === "replies",
|
|
|
|
withFiles: include.value === "files",
|
2022-01-09 13:35:35 +01:00
|
|
|
})),
|
|
|
|
};
|
2020-01-29 20:37:25 +01:00
|
|
|
</script>
|
2021-04-13 20:23:29 +02:00
|
|
|
|
2022-07-14 16:31:01 +02:00
|
|
|
<style lang="scss" module>
|
|
|
|
.tab {
|
|
|
|
margin: calc(var(--margin) / 2) 0;
|
|
|
|
padding: calc(var(--margin) / 2) 0;
|
|
|
|
background: var(--bg);
|
2021-04-13 20:23:29 +02:00
|
|
|
}
|
|
|
|
</style>
|