Skip to content

Commit 04c0a10

Browse files
committed
fix: type issues
1 parent 5bf9899 commit 04c0a10

File tree

2 files changed

+4
-24
lines changed

2 files changed

+4
-24
lines changed

packages/playground/src/components/ai-elements/code-block.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export const CodeBlock = ({
3838
<div
3939
className={cn(
4040
"relative w-full overflow-hidden rounded-md border bg-background text-foreground",
41-
className
41+
className,
4242
)}
4343
{...props}
4444
>

packages/playground/src/components/ai-elements/confirmation.tsx

Lines changed: 3 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ type ConfirmationContextValue = {
4545
};
4646

4747
const ConfirmationContext = createContext<ConfirmationContextValue | null>(
48-
null
48+
null,
4949
);
5050

5151
const useConfirmation = () => {
@@ -96,11 +96,6 @@ export type ConfirmationRequestProps = {
9696
export 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

Comments
 (0)