Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: requested changes on mediainfo
* Remove `Is AVC` field * Refactor component population using loops * General info of an element is always visible, not under tags
- Loading branch information
Showing
9 changed files
with
256 additions
and
374 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 15 additions & 25 deletions
40
frontend/src/components/Item/MediaDetail/MediaDetailAttr.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,29 @@ | ||
<template> | ||
<div class="d-flex flex-row"> | ||
<span class="mdinfo-label">{{ name + ' ' }}</span> | ||
<span class="mdinfo-value">{{ parsedValue }}</span> | ||
</div> | ||
<p> | ||
<b>{{ `${name}: ` }}</b> | ||
<template v-if="!icon"> | ||
{{ value }} | ||
</template> | ||
<v-icon v-else :icon="icon" /> | ||
</p> | ||
</template> | ||
|
||
<script setup lang="ts"> | ||
import { computed } from 'vue'; | ||
import { useI18n } from 'vue-i18n'; | ||
import IMdiCheck from 'virtual:icons/mdi/check'; | ||
import IMdiClose from 'virtual:icons/mdi/close'; | ||
import IMdiHelp from 'virtual:icons/mdi/help'; | ||
export interface MediaDetailAttribute { | ||
const props = defineProps<{ | ||
name: string; | ||
value?: string | number | boolean; | ||
} | ||
}>(); | ||
const props = defineProps<MediaDetailAttribute>(); | ||
const { t } = useI18n(); | ||
const parsedValue = computed(() => { | ||
const icon = computed(() => { | ||
if (typeof props.value === 'boolean') { | ||
return props.value ? t('yes') : t('no'); | ||
return props.value ? IMdiCheck : IMdiClose; | ||
} | ||
return props.value ?? 'Unknown'; | ||
return props.value === 'undefined' ? IMdiHelp : undefined; | ||
}); | ||
</script> | ||
|
||
<style lang="scss" scoped> | ||
.mdinfo-label { | ||
display: inline-block; | ||
font-weight: 600; | ||
} | ||
.mdinfo-value { | ||
display: inline-block; | ||
margin-left: 0.5rem; | ||
font-weight: 400; | ||
} | ||
</style> |
Oops, something went wrong.