pleroma-fe/src/components/mentions_line/mentions_line.js
Henry Jameson dbc9bd9c46 components
2026-02-13 15:21:20 +02:00

40 lines
828 B
JavaScript

import { mapState } from 'pinia'
import MentionLink from 'src/components/mention_link/mention_link.vue'
import { useSyncConfigStore } from 'src/stores/sync_config.js'
export const MENTIONS_LIMIT = 5
const MentionsLine = {
name: 'MentionsLine',
props: {
mentions: {
required: true,
type: Array,
},
},
data: () => ({ expanded: false }),
components: {
MentionLink,
},
computed: {
mentionsComputed() {
return this.mentions.slice(0, MENTIONS_LIMIT)
},
extraMentions() {
return this.mentions.slice(MENTIONS_LIMIT)
},
manyMentions() {
return this.extraMentions.length > 0
},
...mapState(useSyncConfigStore, ['mergedConfig']),
},
methods: {
toggleShowMore() {
this.expanded = !this.expanded
},
},
}
export default MentionsLine