mirror of
https://github.com/YunoHost/yunohost-admin.git
synced 2024-09-03 20:06:15 +02:00
refactor: ReadOnlyAlertItem typing
This commit is contained in:
parent
cc90c50baf
commit
b9cf8b92fe
2 changed files with 15 additions and 9 deletions
|
@ -1,12 +1,13 @@
|
|||
<script setup lang="ts">
|
||||
import { computed } from 'vue'
|
||||
|
||||
const props = defineProps<{
|
||||
label: string
|
||||
id?: string
|
||||
type?: 'success' | 'info' | 'warning' | 'danger'
|
||||
icon?: string
|
||||
}>()
|
||||
import type { ReadOnlyAlertItemProps } from '@/types/form'
|
||||
|
||||
const props = withDefaults(defineProps<ReadOnlyAlertItemProps>(), {
|
||||
id: undefined,
|
||||
icon: undefined,
|
||||
type: 'success',
|
||||
})
|
||||
|
||||
const icon = computed(() => {
|
||||
const icons = {
|
||||
|
@ -22,11 +23,12 @@ const icon = computed(() => {
|
|||
|
||||
<template>
|
||||
<BAlert
|
||||
class="d-flex flex-column flex-md-row align-items-center"
|
||||
:id="id"
|
||||
:model-value="true"
|
||||
:variant="type"
|
||||
:modelValue="true"
|
||||
class="d-flex flex-column flex-md-row align-items-center"
|
||||
>
|
||||
<YIcon :iname="icon" class="me-md-3 mb-md-0 mb-2" :variant="type" />
|
||||
<YIcon :iname="icon" :variant="type" class="me-md-3 mb-md-0 mb-2" />
|
||||
|
||||
<VueShowdown :markdown="label" tag="span" class="markdown" />
|
||||
</BAlert>
|
||||
|
|
|
@ -19,6 +19,10 @@ export type DisplayTextItemProps = BaseDisplayItemProps
|
|||
|
||||
export type MarkdownItemProps = BaseDisplayItemProps
|
||||
|
||||
export type ReadOnlyAlertItemProps = BaseDisplayItemProps & {
|
||||
icon?: string
|
||||
type?: StateVariant
|
||||
}
|
||||
|
||||
// WRITABLE
|
||||
|
||||
|
|
Loading…
Reference in a new issue