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">
|
<script setup lang="ts">
|
||||||
import { computed } from 'vue'
|
import { computed } from 'vue'
|
||||||
|
|
||||||
const props = defineProps<{
|
import type { ReadOnlyAlertItemProps } from '@/types/form'
|
||||||
label: string
|
|
||||||
id?: string
|
const props = withDefaults(defineProps<ReadOnlyAlertItemProps>(), {
|
||||||
type?: 'success' | 'info' | 'warning' | 'danger'
|
id: undefined,
|
||||||
icon?: string
|
icon: undefined,
|
||||||
}>()
|
type: 'success',
|
||||||
|
})
|
||||||
|
|
||||||
const icon = computed(() => {
|
const icon = computed(() => {
|
||||||
const icons = {
|
const icons = {
|
||||||
|
@ -22,11 +23,12 @@ const icon = computed(() => {
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<BAlert
|
<BAlert
|
||||||
class="d-flex flex-column flex-md-row align-items-center"
|
:id="id"
|
||||||
|
:model-value="true"
|
||||||
:variant="type"
|
: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" />
|
<VueShowdown :markdown="label" tag="span" class="markdown" />
|
||||||
</BAlert>
|
</BAlert>
|
||||||
|
|
|
@ -19,6 +19,10 @@ export type DisplayTextItemProps = BaseDisplayItemProps
|
||||||
|
|
||||||
export type MarkdownItemProps = BaseDisplayItemProps
|
export type MarkdownItemProps = BaseDisplayItemProps
|
||||||
|
|
||||||
|
export type ReadOnlyAlertItemProps = BaseDisplayItemProps & {
|
||||||
|
icon?: string
|
||||||
|
type?: StateVariant
|
||||||
|
}
|
||||||
|
|
||||||
// WRITABLE
|
// WRITABLE
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue