@@ -32,6 +32,7 @@ import { useCopyToClipboard } from "~/hooks/useCopyToClipboard";
3232import { resolveThreadRouteTarget } from "~/threadRoutes" ;
3333import {
3434 buildVisibleToastLayout ,
35+ hasVisibleToastAction ,
3536 shouldHideCollapsedToastContent ,
3637 shouldRenderThreadScopedToast ,
3738} from "./toast.logic" ;
@@ -288,7 +289,7 @@ function deriveToastBodyDescriptor(toast: {
288289} ) : ToastBodyDescriptor {
289290 const Icon = toast . type ? TOAST_ICONS [ toast . type as keyof typeof TOAST_ICONS ] : null ;
290291 const stackedActionLayout =
291- toast . actionProps !== undefined && toast . data ?. actionLayout === "stacked-end" ;
292+ hasVisibleToastAction ( toast . actionProps ) && toast . data ?. actionLayout === "stacked-end" ;
292293 const actionVariant : NonNullable < ThreadToastData [ "actionVariant" ] > =
293294 toast . data ?. actionVariant ?? "default" ;
294295 const secondaryActionVariant : NonNullable < ThreadToastData [ "secondaryActionVariant" ] > =
@@ -301,7 +302,7 @@ function deriveToastBodyDescriptor(toast: {
301302 const hasSecondaryAction = toast . data ?. secondaryActionProps !== undefined ;
302303 const hasTrailingControls =
303304 copyErrorText !== null ||
304- toast . actionProps !== undefined ||
305+ hasVisibleToastAction ( toast . actionProps ) ||
305306 hasAdditionalActions ||
306307 hasSecondaryAction ;
307308 const inlineContentEndPad = hasTrailingControls ? "pr-6" : "pr-10" ;
@@ -400,12 +401,12 @@ function ToastBodyContent({
400401 variant = { secondaryActionVariant }
401402 />
402403 ) : null }
403- { actionProps ? (
404+ { hasVisibleToastAction ( actionProps ) ? (
404405 < Toast . Action
405406 className = { cn ( buttonVariants ( { size : "xs" , variant : actionVariant } ) , "shrink-0" ) }
406407 data-slot = "toast-action"
407408 >
408- { actionProps . children }
409+ { actionProps ? .children }
409410 </ Toast . Action >
410411 ) : null }
411412 </ div >
@@ -798,7 +799,7 @@ function AnchoredToasts() {
798799 ) ;
799800}
800801
801- export { stackedThreadToast } from "./toastHelpers" ;
802+ export { hiddenToastActionProps , stackedThreadToast } from "./toastHelpers" ;
802803export type { StackedThreadToastOptions } from "./toastHelpers" ;
803804
804805export {
0 commit comments