fix: update prop types for spoiler

This commit is contained in:
Daniel Roe 2022-12-04 20:00:02 +00:00
parent eb022c92e8
commit bd78834a44
No known key found for this signature in database
GPG key ID: 22D5008E4F5D9B55

View file

@ -1,5 +1,5 @@
<script setup lang="ts">
const props = defineProps<{ enabled: boolean; filter: boolean }>()
const props = defineProps<{ enabled?: boolean; filter?: boolean }>()
const showContent = ref(!props.enabled)
const toggleContent = useToggle(showContent)
@ -19,7 +19,7 @@ watchEffect(() => {
<button btn-text px-2 py-1 text-3 flex="~ center gap-2" :class="showContent ? '' : 'filter-saturate-0 hover:filter-saturate-100'" @click="toggleContent()">
<div v-if="showContent" i-ri:eye-line />
<div v-else i-ri:eye-close-line />
{{ showContent ? $t('status.spoiler_show_less') : $t(props.filter ? 'status.filter_show_anyway' : 'status.spoiler_show_more') }}
{{ showContent ? $t('status.spoiler_show_less') : $t(filter ? 'status.filter_show_anyway' : 'status.spoiler_show_more') }}
</button>
<div border="t base" flex-auto h-1px />
</div>