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