You've already forked AstralRinth
forked from didirus/AstralRinth
b005c1f522
* New project card * no shadow on icons * Remove updated label * reduce tag count to 5 * improve envs * fix: project card bottom row not growing * move actions in grid mode * focus changes + new project list component * Allow more tags in grid mode, deprioritize non-loader tags * fix prod deploy robots.txt * remove unused id * App cards * prepr * publish date + fix router links * fix author hover underline in firefox * perf: preload on search item hover * remove unused filter * remove option for old grid view --------- Co-authored-by: tdgao <mr.trumgao@gmail.com> Co-authored-by: Calum H. (IMB11) <contact@cal.engineer>
67 lines
1.8 KiB
Vue
67 lines
1.8 KiB
Vue
<script setup lang="ts">
|
|
import type { Labrinth } from '@modrinth/api-client'
|
|
import { ClientIcon, GlobeIcon, ServerIcon } from '@modrinth/assets'
|
|
|
|
import { defineMessages, useVIntl } from '../../../composables'
|
|
import { TagItem } from '../../base'
|
|
|
|
const { formatMessage } = useVIntl()
|
|
|
|
export type ProjectCardEnvironmentProps = {
|
|
clientSide: Labrinth.Projects.v2.Environment
|
|
serverSide: Labrinth.Projects.v2.Environment
|
|
}
|
|
|
|
defineProps<ProjectCardEnvironmentProps>()
|
|
|
|
const messages = defineMessages({
|
|
clientOrServer: {
|
|
id: 'project-card.environment.client-or-server',
|
|
defaultMessage: 'Client or server',
|
|
},
|
|
clientAndServer: {
|
|
id: 'project-card.environment.client-and-server',
|
|
defaultMessage: 'Client and server',
|
|
},
|
|
client: {
|
|
id: 'project-card.environment.client',
|
|
defaultMessage: 'Client',
|
|
},
|
|
server: {
|
|
id: 'project-card.environment.server',
|
|
defaultMessage: 'Server',
|
|
},
|
|
})
|
|
</script>
|
|
|
|
<template>
|
|
<TagItem class="empty:hidden">
|
|
<template v-if="clientSide === 'optional' && serverSide === 'optional'">
|
|
<GlobeIcon aria-hidden="true" />
|
|
{{ formatMessage(messages.clientOrServer) }}
|
|
</template>
|
|
<template v-else-if="clientSide === 'required' && serverSide === 'required'">
|
|
<GlobeIcon aria-hidden="true" />
|
|
{{ formatMessage(messages.clientAndServer) }}
|
|
</template>
|
|
<template
|
|
v-else-if="
|
|
(clientSide === 'optional' || clientSide === 'required') &&
|
|
(serverSide === 'optional' || serverSide === 'unsupported')
|
|
"
|
|
>
|
|
<ClientIcon aria-hidden="true" />
|
|
{{ formatMessage(messages.client) }}
|
|
</template>
|
|
<template
|
|
v-else-if="
|
|
(serverSide === 'optional' || serverSide === 'required') &&
|
|
(clientSide === 'optional' || clientSide === 'unsupported')
|
|
"
|
|
>
|
|
<ServerIcon aria-hidden="true" />
|
|
{{ formatMessage(messages.server) }}
|
|
</template>
|
|
</TagItem>
|
|
</template>
|