- {userTranscriptions.map((transcription, idx) => (
-
- ))}
+
+
+
+
+
+
+ {userTranscriptions.map((transcription, idx) => (
+
+ ))}
+
);
diff --git a/app/src/components/NavigateBack.tsx b/app/src/components/NavigateBack.tsx
new file mode 100644
index 0000000..0616c8a
--- /dev/null
+++ b/app/src/components/NavigateBack.tsx
@@ -0,0 +1,31 @@
+'use client'
+
+import { useRouter } from "next/navigation"
+import { Button } from "./ui/button"
+import { ArrowLeftIcon } from "lucide-react"
+
+interface NavigateBackProps {
+ href?: string
+ subHeading?: string
+}
+
+const NavigateBack = (props: NavigateBackProps) => {
+ const { href, subHeading } = props
+ const router = useRouter()
+
+ const handleBack = () => {
+ href ? router.push(href) : router.back()
+ }
+
+ return (
+
+
+ {subHeading &&
{subHeading}
}
+
+ )
+}
+
+export default NavigateBack
\ No newline at end of file
diff --git a/app/src/components/RegisterForm.tsx b/app/src/components/RegisterForm.tsx
index 14c9ebe..9113c39 100644
--- a/app/src/components/RegisterForm.tsx
+++ b/app/src/components/RegisterForm.tsx
@@ -19,10 +19,11 @@ import { useMutation } from "@tanstack/react-query";
import axios, { AxiosError } from "axios";
import { toast } from "sonner";
import { useRouter } from "next/navigation";
-import { useEffect } from "react";
+import { useEffect, useState } from "react";
const RegisterForm = () => {
const router = useRouter();
+ const [isPersistingUser,setIsPersistingUser] = useState(false);
useEffect(() => {
if (typeof window !== "undefined" && localStorage.getItem("user")) {
@@ -51,6 +52,7 @@ const RegisterForm = () => {
}
form.reset();
router.push("/new");
+ setIsPersistingUser(false);
},
onError: (error) => {
if (error instanceof AxiosError) {
@@ -67,6 +69,7 @@ const RegisterForm = () => {
});
const onSubmit = (data: RegisterUserRequest) => {
+ setIsPersistingUser(true);
mutate(data);
};
@@ -110,7 +113,8 @@ const RegisterForm = () => {
/>