diff --git a/apps/frontend/src/components/ui/ProjectDownloadModal/index.vue b/apps/frontend/src/components/ui/ProjectDownloadModal/index.vue
index 94d239aa8a..76a9479fde 100644
--- a/apps/frontend/src/components/ui/ProjectDownloadModal/index.vue
+++ b/apps/frontend/src/components/ui/ProjectDownloadModal/index.vue
@@ -37,31 +37,44 @@
@download="onDownload"
/>
@@ -85,18 +98,21 @@ import type { Labrinth } from '@modrinth/api-client'
import { DownloadIcon, FileIcon } from '@modrinth/assets'
import {
Avatar,
+ ButtonStyled,
type CdnDownloadReason,
defineMessages,
+ fileTypeMessages,
injectModrinthClient,
NewModal,
ServersPromo,
+ TagItem,
truncatedTooltip,
useDebugLogger,
useVIntl,
} from '@modrinth/ui'
import type { DisplayProjectType } from '@modrinth/utils'
import { useQuery } from '@tanstack/vue-query'
-import { computed, nextTick, onUnmounted, ref, watch } from 'vue'
+import { type ComponentPublicInstance, computed, nextTick, onUnmounted, ref, watch } from 'vue'
import { navigateTo } from '#app'
import { saveFeatureFlags } from '~/composables/featureFlags.ts'
@@ -163,6 +179,7 @@ const debug = useDebugLogger('DownloadModal')
const modal = ref(null)
const downloadTitleRef = ref(null)
+const additionalFileNameRefs = ref>({})
const modalOpen = ref(false)
const showProjectId = ref(null)
const showOptions = ref(getDefaultShowOptions())
@@ -274,14 +291,20 @@ const messages = defineMessages({
},
})
-const fileTypeLabels: Partial> = {
- 'required-resource-pack': 'Resourcepack',
- 'optional-resource-pack': 'Resourcepack',
- unknown: 'File',
+function fileTypeLabel(type?: Labrinth.Versions.v3.FileType | null) {
+ return formatMessage(fileTypeMessages[type ?? 'unknown'] ?? fileTypeMessages.unknown)
}
-function fileTypeLabel(type?: Labrinth.Versions.v3.FileType) {
- return fileTypeLabels[type ?? 'unknown'] || 'File'
+function additionalFileKey(file: Labrinth.Versions.v3.VersionFile) {
+ return file.hashes?.sha1 ?? file.filename
+}
+
+function setAdditionalFileNameRef(
+ file: Labrinth.Versions.v3.VersionFile,
+ element: Element | ComponentPublicInstance | null,
+) {
+ additionalFileNameRefs.value[additionalFileKey(file)] =
+ element instanceof HTMLElement ? element : null
}
function getProjectTypeForUrl(