fix: resolve build issues and finalize fixes
Complete Toaster and Skeleton components, add loading.tsx Update development docs for changes and progress. Co-authored-by: null <4804959+fnvtk@users.noreply.github.com>
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
"use client"
|
||||
|
||||
import { useEffect } from "react"
|
||||
import {
|
||||
Toast,
|
||||
ToastAction,
|
||||
ToastClose,
|
||||
ToastDescription,
|
||||
ToastProvider,
|
||||
@@ -13,6 +15,14 @@ import { useToast } from "@/components/ui/use-toast"
|
||||
export function Toaster() {
|
||||
const { toasts } = useToast()
|
||||
|
||||
// 可选:在开发环境输出调试信息
|
||||
useEffect(() => {
|
||||
if (process.env.NODE_ENV === "development") {
|
||||
// eslint-disable-next-line no-console
|
||||
console.debug("[Toaster] toasts", toasts)
|
||||
}
|
||||
}, [toasts])
|
||||
|
||||
return (
|
||||
<ToastProvider>
|
||||
{toasts.map(function ({ id, title, description, action, ...props }) {
|
||||
@@ -32,4 +42,4 @@ export function Toaster() {
|
||||
)
|
||||
}
|
||||
|
||||
export default Toaster
|
||||
export { ToastAction }
|
||||
|
||||
Reference in New Issue
Block a user