1
0
Files
AstralRinth/packages/ui/src/components/project/server/ServerModpackContentCard.vue
T
Jerozgen 58c1e225c8 Sort filters and add translations for servers (#5493)
* Translate and sort server filters

* Set team_members to unknown[]

* Additional fixes after merge

* Additional translations

* Replace "IP" with "server address"

* Prioritize English and user language
2026-03-17 19:56:01 +00:00

62 lines
1.8 KiB
Vue

<template>
<div class="flex gap-1.5 items-center justify-between px-3 pr-1.5 py-1.5 rounded-2xl bg-bg">
<div class="grid grid-cols-[auto_1fr] gap-1.5 items-center">
<Avatar :src="icon" size="34px" class="!rounded-xl !shadow-none" />
<div class="flex flex-col items-start overflow-hidden">
<div
v-tooltip="showCustomModpackTooltip ? formatMessage(messages.customModpackTooltip) : name"
class="truncate font-semibold text-sm max-w-full"
:class="onclickName ? 'hover:underline cursor-pointer' : ''"
@click="onclickName"
>
{{ name }}
</div>
<div
v-tooltip="versionNumber"
class="truncate font-medium text-sm max-w-full"
:class="onclickVersion ? 'hover:underline cursor-pointer' : ''"
@click="onclickVersion"
>
{{ versionNumber }}
</div>
</div>
</div>
<ButtonStyled v-if="onclickDownload" circular type="transparent">
<button v-tooltip="formatMessage(messages.downloadModpack)" @click="onclickDownload">
<DownloadIcon />
</button>
</ButtonStyled>
</div>
</template>
<script setup lang="ts">
import { DownloadIcon } from '@modrinth/assets/generated-icons'
import { defineMessages, useVIntl } from '../../../composables'
import Avatar from '../../base/Avatar.vue'
import ButtonStyled from '../../base/ButtonStyled.vue'
defineProps<{
name: string
versionNumber: string
icon?: string
onclickName?: () => void
onclickVersion?: () => void
onclickDownload?: () => void
showCustomModpackTooltip?: boolean
}>()
const { formatMessage } = useVIntl()
const messages = defineMessages({
customModpackTooltip: {
id: `project.server.customModpackTooltip`,
defaultMessage: 'This project uses a custom modpack',
},
downloadModpack: {
id: `project.about.server.downloadModpack`,
defaultMessage: 'Download modpack',
},
})
</script>