mirror of
https://github.com/zyycn/codex-proxy-rs.git
synced 2026-11-06 08:06:19 +00:00
Introduce Seed-to-Component token derivation, isolated live previews, semantic base component theming, and responsive theme controls. Co-authored-by: Codex <noreply@openai.com>
75 lines
1.5 KiB
Vue
75 lines
1.5 KiB
Vue
<script setup lang="ts">
|
|
import BaseButton from './BaseButton.vue'
|
|
import BaseModal from './BaseModal/index.vue'
|
|
|
|
const props = withDefaults(
|
|
defineProps<{
|
|
title: string
|
|
description?: string
|
|
destructive?: boolean
|
|
confirmText?: string
|
|
cancelText?: string
|
|
loading?: boolean
|
|
confirmDisabled?: boolean
|
|
}>(),
|
|
{
|
|
destructive: false,
|
|
confirmText: '确认',
|
|
cancelText: '取消',
|
|
loading: false,
|
|
confirmDisabled: false,
|
|
},
|
|
)
|
|
|
|
const emit = defineEmits<{
|
|
confirm: []
|
|
cancel: []
|
|
}>()
|
|
const open = defineModel<boolean>({ default: false })
|
|
function handleCancel() {
|
|
if (props.loading)
|
|
return
|
|
open.value = false
|
|
emit('cancel')
|
|
}
|
|
|
|
function handleConfirm() {
|
|
if (props.loading || props.confirmDisabled)
|
|
return
|
|
emit('confirm')
|
|
}
|
|
</script>
|
|
|
|
<template>
|
|
<BaseModal
|
|
v-model="open"
|
|
:title="title"
|
|
:description="description"
|
|
size="sm"
|
|
:tone="destructive ? 'danger' : 'warning'"
|
|
role="alertdialog"
|
|
:dismissible="!loading"
|
|
>
|
|
<div
|
|
v-if="$slots.default"
|
|
class="text-cp-lg leading-[1.55] font-emphasis text-cp-text-secondary"
|
|
>
|
|
<slot />
|
|
</div>
|
|
|
|
<template #footer>
|
|
<BaseButton variant="secondary" :disabled="loading" @click="handleCancel">
|
|
{{ cancelText }}
|
|
</BaseButton>
|
|
<BaseButton
|
|
:variant="destructive ? 'destructive' : 'primary'"
|
|
:loading="loading"
|
|
:disabled="confirmDisabled"
|
|
@click="handleConfirm"
|
|
>
|
|
{{ confirmText }}
|
|
</BaseButton>
|
|
</template>
|
|
</BaseModal>
|
|
</template>
|