Add hasRating prop for showing ( no comment ) text
This commit is contained in:
@@ -1,21 +1,23 @@
|
||||
<script lang="ts" setup>
|
||||
|
||||
// types
|
||||
|
||||
type Props = {
|
||||
rate: number
|
||||
}
|
||||
rate: number;
|
||||
haveRate?: boolean;
|
||||
};
|
||||
|
||||
// props
|
||||
|
||||
defineProps<Props>();
|
||||
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="flex items-center gap-2">
|
||||
<span class="typo-p-sm font-normal translate-y-px">
|
||||
{{ rate }}
|
||||
<template v-if="haveRate">
|
||||
{{ rate }}
|
||||
</template>
|
||||
<template v-else> ( بدون نظر ) </template>
|
||||
</span>
|
||||
<div class="flex items-center gap-1">
|
||||
<Icon
|
||||
@@ -30,4 +32,4 @@ defineProps<Props>();
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</template>
|
||||
|
||||
Reference in New Issue
Block a user