2025-03-29 16:50:39 +08:00
|
|
|
import { type ClassValue, clsx } from "clsx"
|
|
|
|
|
import { twMerge } from "tailwind-merge"
|
|
|
|
|
|
|
|
|
|
export function cn(...inputs: ClassValue[]) {
|
|
|
|
|
return twMerge(clsx(inputs))
|
|
|
|
|
}
|
|
|
|
|
|
2025-07-07 17:08:27 +08:00
|
|
|
// 添加 toast 函数
|
|
|
|
|
type ToastType = {
|
|
|
|
|
title: string
|
|
|
|
|
description: string
|
|
|
|
|
variant?: "default" | "destructive" | "secondary"
|
2025-03-31 12:04:59 +08:00
|
|
|
}
|
|
|
|
|
|
2025-07-07 17:08:27 +08:00
|
|
|
export const toast = ({ title, description, variant = "default" }: ToastType) => {
|
|
|
|
|
console.log(`[${variant.toUpperCase()}] ${title}: ${description}`)
|
|
|
|
|
// 这里可以实现实际的 toast 逻辑
|
|
|
|
|
// 如果有全局的 toast 组件,可以在这里调用
|
2025-03-31 12:04:59 +08:00
|
|
|
}
|