feat(removed): sub_section_writer

- Its bad and not needed.
This commit is contained in:
DESKTOP-RTLN3BA\$punk 2025-10-27 20:30:10 -07:00
parent 5ac6ebf199
commit 81ddc81026
57 changed files with 2213 additions and 4023 deletions

View file

@ -3,16 +3,16 @@
import { AnimatePresence, motion } from "motion/react";
import Link from "next/link";
import { useRouter } from "next/navigation";
import { useTranslations } from "next-intl";
import { useEffect, useState } from "react";
import { toast } from "sonner";
import { useTranslations } from "next-intl";
import { Logo } from "@/components/Logo";
import { getAuthErrorDetails, isNetworkError, shouldRetry } from "@/lib/auth-errors";
import { AmbientBackground } from "../login/AmbientBackground";
export default function RegisterPage() {
const t = useTranslations('auth');
const tCommon = useTranslations('common');
const t = useTranslations("auth");
const tCommon = useTranslations("common");
const [email, setEmail] = useState("");
const [password, setPassword] = useState("");
const [confirmPassword, setConfirmPassword] = useState("");
@ -34,10 +34,10 @@ export default function RegisterPage() {
// Form validation
if (password !== confirmPassword) {
setError(t('passwords_no_match'));
setErrorTitle(t('password_mismatch'));
toast.error(t('password_mismatch'), {
description: t('passwords_no_match_desc'),
setError(t("passwords_no_match"));
setErrorTitle(t("password_mismatch"));
toast.error(t("password_mismatch"), {
description: t("passwords_no_match_desc"),
duration: 4000,
});
return;
@ -48,7 +48,7 @@ export default function RegisterPage() {
setErrorTitle(null);
// Show loading toast
const loadingToast = toast.loading(t('creating_account'));
const loadingToast = toast.loading(t("creating_account"));
try {
const response = await fetch(`${process.env.NEXT_PUBLIC_FASTAPI_BACKEND_URL}/auth/register`, {
@ -86,9 +86,9 @@ export default function RegisterPage() {
}
// Success toast
toast.success(t('register_success'), {
toast.success(t("register_success"), {
id: loadingToast,
description: t('redirecting_login'),
description: t("redirecting_login"),
duration: 2000,
});
@ -123,7 +123,7 @@ export default function RegisterPage() {
// Add retry action if the error is retryable
if (shouldRetry(errorCode)) {
toastOptions.action = {
label: tCommon('retry'),
label: tCommon("retry"),
onClick: () => handleSubmit(e),
};
}
@ -140,7 +140,7 @@ export default function RegisterPage() {
<div className="mx-auto flex h-screen max-w-lg flex-col items-center justify-center">
<Logo className="rounded-md" />
<h1 className="my-8 text-xl font-bold text-neutral-800 dark:text-neutral-100 md:text-4xl">
{t('create_account')}
{t("create_account")}
</h1>
<div className="w-full max-w-md">
@ -212,7 +212,7 @@ export default function RegisterPage() {
htmlFor="email"
className="block text-sm font-medium text-gray-700 dark:text-gray-300"
>
{t('email')}
{t("email")}
</label>
<input
id="email"
@ -234,7 +234,7 @@ export default function RegisterPage() {
htmlFor="password"
className="block text-sm font-medium text-gray-700 dark:text-gray-300"
>
{t('password')}
{t("password")}
</label>
<input
id="password"
@ -256,7 +256,7 @@ export default function RegisterPage() {
htmlFor="confirmPassword"
className="block text-sm font-medium text-gray-700 dark:text-gray-300"
>
{t('confirm_password')}
{t("confirm_password")}
</label>
<input
id="confirmPassword"
@ -278,18 +278,18 @@ export default function RegisterPage() {
disabled={isLoading}
className="w-full rounded-md bg-blue-600 px-4 py-2 text-white shadow-sm hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 transition-colors"
>
{isLoading ? t('creating_account_btn') : t('register')}
{isLoading ? t("creating_account_btn") : t("register")}
</button>
</form>
<div className="mt-4 text-center text-sm">
<p className="text-gray-600 dark:text-gray-400">
{t('already_have_account')}{" "}
{t("already_have_account")}{" "}
<Link
href="/login"
className="font-medium text-blue-600 hover:text-blue-500 dark:text-blue-400"
>
{t('sign_in')}
{t("sign_in")}
</Link>
</p>
</div>