Fix TypeScript errors

Addresses TypeScript errors related to toast implementation and type definitions.
This commit is contained in:
gpt-engineer-app[bot]
2025-03-16 09:15:27 +00:00
parent 7ab79d125e
commit 7b50054da4
6 changed files with 23 additions and 17 deletions

View File

@@ -1,3 +1,4 @@
import * as React from "react"
import { ToastProps } from "@/components/ui/toast"
@@ -68,22 +69,17 @@ export const useToast = () => {
addToast,
updateToast,
dismissToast,
toast: (props: ToasterToast) => addToast(props), // toast 속성 추가
};
};
// 전역 토스트 함수에도 기본 지속 시간 적용
export const toast = ({
...props
}: ToastActionElement & {
title?: React.ReactNode;
description?: React.ReactNode;
duration?: number;
}) => {
export const toast = (props: Omit<ToasterToast, "id">) => {
// 기본 지속 시간을 적용
const toastWithDefaults = {
...props,
duration: props.duration || DEFAULT_TOAST_DURATION,
};
return toastStore.getState().addToast(toastWithDefaults);
return useToastStore().addToast(toastWithDefaults);
};