diff --git a/apps/web/src/components/alert.tsx b/apps/web/src/components/alert.tsx
index e548b0e..29dd54b 100644
--- a/apps/web/src/components/alert.tsx
+++ b/apps/web/src/components/alert.tsx
@@ -65,6 +65,11 @@ export function CustomAlert({
className="mt-2"
value={typeToConfirmValue}
onChange={(e) => setTypeToConfirmValue(e.target.value)}
+ onKeyDown={(e) => {
+ if (e.key === "Enter" && !disabled) {
+ onConfirm();
+ }
+ }}
/>
)}
diff --git a/apps/web/src/features/library/components/library-rename-modal.tsx b/apps/web/src/features/library/components/library-rename-modal.tsx
index 68ccf55..acaac82 100644
--- a/apps/web/src/features/library/components/library-rename-modal.tsx
+++ b/apps/web/src/features/library/components/library-rename-modal.tsx
@@ -3,16 +3,16 @@ import { useMutation } from "@tanstack/react-query";
import { toast } from "sonner";
import { useFileMutations, useLibraryStore } from "@acme/features/library";
+import { Button } from "@acme/ui/button";
import {
- AlertDialog,
- AlertDialogAction,
- AlertDialogCancel,
- AlertDialogContent,
- AlertDialogDescription,
- AlertDialogFooter,
- AlertDialogHeader,
- AlertDialogTitle,
-} from "@acme/ui/alert-dialog";
+ Dialog,
+ DialogClose,
+ DialogContent,
+ DialogDescription,
+ DialogFooter,
+ DialogHeader,
+ DialogTitle,
+} from "@acme/ui/dialog";
import { Input } from "@acme/ui/input";
export function LibraryRenameModal() {
@@ -38,44 +38,48 @@ export function LibraryRenameModal() {
});
return (
-
- {
e.preventDefault();
inputRef.current?.focus();
}}
>
-
- Rename File
-
-
-
- Enter a new name for the file.
-
- setNewFileName(e.target.value)}
- placeholder="Enter a new name..."
- />
-
-
- Cancel
- {
- if (!selectedFile) return;
- renameFile({ id: selectedFile.id, name: newFileName });
- setLibraryRenameModalOpen(false);
- setNewFileName("");
- }}
- >
- Rename
-
-
-
-
+
+
+
);
}
diff --git a/apps/web/src/features/thread/components/thread-rename-modal.tsx b/apps/web/src/features/thread/components/thread-rename-modal.tsx
index 8f74554..fab0e64 100644
--- a/apps/web/src/features/thread/components/thread-rename-modal.tsx
+++ b/apps/web/src/features/thread/components/thread-rename-modal.tsx
@@ -3,7 +3,16 @@ import { useMutation } from "@tanstack/react-query";
import { toast } from "sonner";
import { useThreadMutations, useThreadStore } from "@acme/features/thread";
-import * as Alert from "@acme/ui/alert-dialog";
+import { Button } from "@acme/ui/button";
+import {
+ Dialog,
+ DialogClose,
+ DialogContent,
+ DialogDescription,
+ DialogFooter,
+ DialogHeader,
+ DialogTitle,
+} from "@acme/ui/dialog";
import { Input } from "@acme/ui/input";
export function ThreadRenameModal() {
@@ -26,7 +35,7 @@ export function ThreadRenameModal() {
const inputRef = useRef(null);
return (
- {
if (open) {
@@ -37,43 +46,47 @@ export function ThreadRenameModal() {
}
}}
>
- {
e.preventDefault();
inputRef.current?.focus();
}}
>
-
- Rename Thread
-
-
-
- Enter a new name for the thread.
-
- setNewThreadName(e.target.value)}
- placeholder="Enter a new name..."
- />
-
-
- Cancel
- {
- if (!hoveredThread) return;
- renameThread({
- threadId: hoveredThread.id,
- name: newThreadName,
- });
- setRenameModalOpen(false);
- setNewThreadName("");
- }}
- >
- Rename
-
-
-
-
+
+
+
);
}
diff --git a/packages/ui/src/components/dialog.tsx b/packages/ui/src/components/dialog.tsx
index 0a1d72d..c1b525e 100644
--- a/packages/ui/src/components/dialog.tsx
+++ b/packages/ui/src/components/dialog.tsx
@@ -60,7 +60,7 @@ function DialogContent({