2023-07-27 05:31:52 +00:00
|
|
|
<!--
|
2024-02-13 15:59:27 +00:00
|
|
|
SPDX-FileCopyrightText: syuilo and misskey-project
|
2023-07-27 05:31:52 +00:00
|
|
|
SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
-->
|
|
|
|
|
2023-03-17 06:09:43 +00:00
|
|
|
<template>
|
2024-04-14 12:30:24 +00:00
|
|
|
<MkA :to="`/clips/${clip.id}`" :class="$style.link">
|
|
|
|
<div :class="$style.root" class="_panel _gaps_s">
|
|
|
|
<b>{{ clip.name }}</b>
|
|
|
|
<div :class="$style.description">
|
|
|
|
<div v-if="clip.description"><Mfm :text="clip.description" :plain="true" :nowrap="true"/></div>
|
|
|
|
<div v-if="clip.lastClippedAt">{{ i18n.ts.updatedAt }}: <MkTime :time="clip.lastClippedAt" mode="detail"/></div>
|
|
|
|
<div v-if="clip.notesCount != null">{{ i18n.ts.notesCount }}: {{ number(clip.notesCount) }} / {{ $i?.policies.noteEachClipsLimit }} ({{ i18n.tsx.remainingN({ n: remaining }) }})</div>
|
|
|
|
</div>
|
|
|
|
<div :class="$style.divider"></div>
|
|
|
|
<div>
|
|
|
|
<MkAvatar :user="clip.user" :class="$style.userAvatar" indicator link preview/> <MkUserName :user="clip.user" :nowrap="false"/>
|
|
|
|
</div>
|
2023-03-17 06:09:43 +00:00
|
|
|
</div>
|
2024-04-14 12:30:24 +00:00
|
|
|
</MkA>
|
2023-03-17 06:09:43 +00:00
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts" setup>
|
2024-04-14 12:30:24 +00:00
|
|
|
import * as Misskey from 'misskey-js';
|
|
|
|
import { computed } from 'vue';
|
2023-09-19 07:37:43 +00:00
|
|
|
import { i18n } from '@/i18n.js';
|
2024-04-14 12:30:24 +00:00
|
|
|
import { $i } from '@/account.js';
|
|
|
|
import number from '@/filters/number.js';
|
2023-03-17 06:09:43 +00:00
|
|
|
|
2024-04-14 12:30:24 +00:00
|
|
|
const props = defineProps<{
|
|
|
|
clip: Misskey.entities.Clip;
|
2023-03-17 06:09:43 +00:00
|
|
|
}>();
|
2024-04-14 12:30:24 +00:00
|
|
|
|
|
|
|
const remaining = computed(() => {
|
|
|
|
return ($i?.policies && props.clip.notesCount != null) ? ($i.policies.noteEachClipsLimit - props.clip.notesCount) : i18n.ts.unknown;
|
|
|
|
});
|
2023-03-17 06:09:43 +00:00
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss" module>
|
2024-04-14 12:30:24 +00:00
|
|
|
.link {
|
2023-03-17 06:09:43 +00:00
|
|
|
display: block;
|
2024-04-14 12:30:24 +00:00
|
|
|
|
2024-07-12 07:25:44 +00:00
|
|
|
&:focus-visible {
|
|
|
|
outline: none;
|
|
|
|
|
|
|
|
.root {
|
|
|
|
box-shadow: inset 0 0 0 2px var(--focus);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-04-14 12:30:24 +00:00
|
|
|
&:hover {
|
|
|
|
text-decoration: none;
|
|
|
|
color: var(--accent);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.root {
|
2023-03-17 06:09:43 +00:00
|
|
|
padding: 16px;
|
|
|
|
}
|
|
|
|
|
2024-04-14 12:30:24 +00:00
|
|
|
.divider {
|
|
|
|
height: 1px;
|
|
|
|
background: var(--divider);
|
2023-03-17 06:09:43 +00:00
|
|
|
}
|
|
|
|
|
2024-04-14 12:30:24 +00:00
|
|
|
.description {
|
|
|
|
font-size: 90%;
|
2023-03-17 06:09:43 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.userAvatar {
|
|
|
|
width: 32px;
|
|
|
|
height: 32px;
|
|
|
|
}
|
|
|
|
</style>
|