@@ -45,7 +45,7 @@ type ConfirmationContextValue = {
4545} ;
4646
4747const ConfirmationContext = createContext < ConfirmationContextValue | null > (
48- null
48+ null ,
4949) ;
5050
5151const useConfirmation = ( ) => {
@@ -96,11 +96,6 @@ export type ConfirmationRequestProps = {
9696export const ConfirmationRequest = ( { children } : ConfirmationRequestProps ) => {
9797 const { state } = useConfirmation ( ) ;
9898
99- // Only show when approval is requested
100- if ( state !== "approval-requested" ) {
101- return null ;
102- }
103-
10499 return children ;
105100} ;
106101
@@ -114,12 +109,7 @@ export const ConfirmationAccepted = ({
114109 const { approval, state } = useConfirmation ( ) ;
115110
116111 // Only show when approved and in response states
117- if (
118- ! approval ?. approved ||
119- ( state !== "approval-responded" &&
120- state !== "output-denied" &&
121- state !== "output-available" )
122- ) {
112+ if ( ! approval ?. approved || state !== "output-available" ) {
123113 return null ;
124114 }
125115
@@ -136,12 +126,7 @@ export const ConfirmationRejected = ({
136126 const { approval, state } = useConfirmation ( ) ;
137127
138128 // Only show when rejected and in response states
139- if (
140- approval ?. approved !== false ||
141- ( state !== "approval-responded" &&
142- state !== "output-denied" &&
143- state !== "output-available" )
144- ) {
129+ if ( approval ?. approved !== false || state !== "output-available" ) {
145130 return null ;
146131 }
147132
@@ -156,11 +141,6 @@ export const ConfirmationActions = ({
156141} : ConfirmationActionsProps ) => {
157142 const { state } = useConfirmation ( ) ;
158143
159- // Only show when approval is requested
160- if ( state !== "approval-requested" ) {
161- return null ;
162- }
163-
164144 return (
165145 < div
166146 className = { cn ( "flex items-center justify-end gap-2 self-end" , className ) }
0 commit comments