Download apps/vscode/webview-ui/src/components/StreamingConfirmDialog.tsx from SaylorTwift/kimi-code: direct link, hf CLI and curl.
- Browser
- Download file 1.76 kB
-
https://huggingface.co/SaylorTwift/kimi-code/resolve/main/apps/vscode/webview-ui/src/components/StreamingConfirmDialog.tsx
- Command line
-
hf download hf://SaylorTwift/kimi-code/apps/vscode/webview-ui/src/components/StreamingConfirmDialog.tsx
-
curl -L -o StreamingConfirmDialog.tsx https://huggingface.co/SaylorTwift/kimi-code/resolve/main/apps/vscode/webview-ui/src/components/StreamingConfirmDialog.tsx
1.76 kB
| import { | |
| AlertDialog, | |
| AlertDialogAction, | |
| AlertDialogCancel, | |
| AlertDialogContent, | |
| AlertDialogDescription, | |
| AlertDialogFooter, | |
| AlertDialogHeader, | |
| AlertDialogTitle, | |
| } from "@/components/ui/alert-dialog"; | |
| interface StreamingConfirmDialogProps { | |
| open: boolean; | |
| onOpenChange: (open: boolean) => void; | |
| title: string; | |
| description?: string; | |
| confirmLabel?: string; | |
| cancelLabel?: string; | |
| onConfirm: () => void; | |
| confirmDisabled?: boolean; | |
| cancelDisabled?: boolean; | |
| confirmLoading?: boolean; | |
| } | |
| export function StreamingConfirmDialog({ | |
| open, | |
| onOpenChange, | |
| title, | |
| description = "The current conversation is still generating a response. This action will truncate the output. Are you sure you want to continue?", | |
| confirmLabel = "Continue", | |
| cancelLabel = "Cancel", | |
| onConfirm, | |
| confirmDisabled = false, | |
| cancelDisabled = false, | |
| confirmLoading = false, | |
| }: StreamingConfirmDialogProps) { | |
| return ( | |
| <AlertDialog open={open} onOpenChange={onOpenChange}> | |
| <AlertDialogContent> | |
| <AlertDialogHeader> | |
| <AlertDialogTitle>{title}</AlertDialogTitle> | |
| <AlertDialogDescription>{description}</AlertDialogDescription> | |
| </AlertDialogHeader> | |
| <AlertDialogFooter> | |
| <AlertDialogCancel onClick={() => onOpenChange(false)} disabled={cancelDisabled}> | |
| {cancelLabel} | |
| </AlertDialogCancel> | |
| <AlertDialogAction | |
| onClick={onConfirm} | |
| disabled={confirmDisabled} | |
| className="bg-destructive text-destructive-foreground hover:bg-destructive/90" | |
| > | |
| {confirmLoading ? `${confirmLabel}…` : confirmLabel} | |
| </AlertDialogAction> | |
| </AlertDialogFooter> | |
| </AlertDialogContent> | |
| </AlertDialog> | |
| ); | |
| } | |