mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-07-04 22:02:16 +02:00
Biome: fixes for app/(api, login, onboard, register, settings) directories
This commit is contained in:
parent
3164c0c8cc
commit
4d7cb00fa7
8 changed files with 31 additions and 31 deletions
|
|
@ -1,4 +1,4 @@
|
||||||
import { source } from "@/lib/source";
|
|
||||||
import { createFromSource } from "fumadocs-core/search/server";
|
import { createFromSource } from "fumadocs-core/search/server";
|
||||||
|
import { source } from "@/lib/source";
|
||||||
|
|
||||||
export const { GET } = createFromSource(source);
|
export const { GET } = createFromSource(source);
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,4 @@
|
||||||
"use client";
|
"use client";
|
||||||
import React from "react";
|
|
||||||
|
|
||||||
export const AmbientBackground = () => {
|
export const AmbientBackground = () => {
|
||||||
return (
|
return (
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,4 @@
|
||||||
"use client";
|
"use client";
|
||||||
import React from "react";
|
|
||||||
import { IconBrandGoogleFilled } from "@tabler/icons-react";
|
import { IconBrandGoogleFilled } from "@tabler/icons-react";
|
||||||
import { motion } from "framer-motion";
|
import { motion } from "framer-motion";
|
||||||
import { Logo } from "@/components/Logo";
|
import { Logo } from "@/components/Logo";
|
||||||
|
|
@ -59,6 +58,7 @@ export function GoogleLoginButton() {
|
||||||
strokeLinejoin="round"
|
strokeLinejoin="round"
|
||||||
className="flex-shrink-0"
|
className="flex-shrink-0"
|
||||||
>
|
>
|
||||||
|
<title>Google Logo</title>
|
||||||
<path d="M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z" />
|
<path d="M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z" />
|
||||||
<line x1="12" y1="9" x2="12" y2="13" />
|
<line x1="12" y1="9" x2="12" y2="13" />
|
||||||
<line x1="12" y1="17" x2="12.01" y2="17" />
|
<line x1="12" y1="17" x2="12.01" y2="17" />
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,7 @@
|
||||||
"use client";
|
"use client";
|
||||||
import type React from "react";
|
|
||||||
import { useState, useEffect } from "react";
|
|
||||||
import { useRouter } from "next/navigation";
|
|
||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
|
import { useRouter } from "next/navigation";
|
||||||
|
import { useEffect, useState } from "react";
|
||||||
|
|
||||||
export function LocalLoginForm() {
|
export function LocalLoginForm() {
|
||||||
const [username, setUsername] = useState("");
|
const [username, setUsername] = useState("");
|
||||||
|
|
@ -46,9 +45,10 @@ export function LocalLoginForm() {
|
||||||
throw new Error(data.detail || "Failed to login");
|
throw new Error(data.detail || "Failed to login");
|
||||||
}
|
}
|
||||||
|
|
||||||
router.push("/auth/callback?token=" + data.access_token);
|
router.push(`/auth/callback?token=${data.access_token}`);
|
||||||
} catch (err: any) {
|
} catch (err) {
|
||||||
setError(err.message || "An error occurred during login");
|
const errorMessage = err instanceof Error ? err.message : "An error occurred during login";
|
||||||
|
setError(errorMessage);
|
||||||
} finally {
|
} finally {
|
||||||
setIsLoading(false);
|
setIsLoading(false);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,12 @@
|
||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import { useState, useEffect, Suspense } from "react";
|
import { Loader2 } from "lucide-react";
|
||||||
import { GoogleLoginButton } from "./GoogleLoginButton";
|
import { useSearchParams } from "next/navigation";
|
||||||
import { LocalLoginForm } from "./LocalLoginForm";
|
import { Suspense, useEffect, useState } from "react";
|
||||||
import { Logo } from "@/components/Logo";
|
import { Logo } from "@/components/Logo";
|
||||||
import { AmbientBackground } from "./AmbientBackground";
|
import { AmbientBackground } from "./AmbientBackground";
|
||||||
import { useSearchParams } from "next/navigation";
|
import { GoogleLoginButton } from "./GoogleLoginButton";
|
||||||
import { Loader2 } from "lucide-react";
|
import { LocalLoginForm } from "./LocalLoginForm";
|
||||||
|
|
||||||
function LoginContent() {
|
function LoginContent() {
|
||||||
const [authType, setAuthType] = useState<string | null>(null);
|
const [authType, setAuthType] = useState<string | null>(null);
|
||||||
|
|
|
||||||
|
|
@ -1,17 +1,17 @@
|
||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import React, { useState, useEffect } from "react";
|
import { AnimatePresence, motion } from "framer-motion";
|
||||||
|
import { ArrowLeft, ArrowRight, Bot, CheckCircle, Sparkles } from "lucide-react";
|
||||||
import { useRouter } from "next/navigation";
|
import { useRouter } from "next/navigation";
|
||||||
import { motion, AnimatePresence } from "framer-motion";
|
import { useEffect, useState } from "react";
|
||||||
import { Button } from "@/components/ui/button";
|
|
||||||
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card";
|
|
||||||
import { Progress } from "@/components/ui/progress";
|
|
||||||
import { CheckCircle, ArrowRight, ArrowLeft, Bot, Sparkles, Zap, Brain } from "lucide-react";
|
|
||||||
import { Logo } from "@/components/Logo";
|
import { Logo } from "@/components/Logo";
|
||||||
import { useLLMConfigs, useLLMPreferences } from "@/hooks/use-llm-configs";
|
|
||||||
import { AddProviderStep } from "@/components/onboard/add-provider-step";
|
import { AddProviderStep } from "@/components/onboard/add-provider-step";
|
||||||
import { AssignRolesStep } from "@/components/onboard/assign-roles-step";
|
import { AssignRolesStep } from "@/components/onboard/assign-roles-step";
|
||||||
import { CompletionStep } from "@/components/onboard/completion-step";
|
import { CompletionStep } from "@/components/onboard/completion-step";
|
||||||
|
import { Button } from "@/components/ui/button";
|
||||||
|
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card";
|
||||||
|
import { Progress } from "@/components/ui/progress";
|
||||||
|
import { useLLMConfigs, useLLMPreferences } from "@/hooks/use-llm-configs";
|
||||||
|
|
||||||
const TOTAL_STEPS = 3;
|
const TOTAL_STEPS = 3;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
"use client";
|
"use client";
|
||||||
import type React from "react";
|
|
||||||
import { useState, useEffect } from "react";
|
|
||||||
import { useRouter } from "next/navigation";
|
|
||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
|
import { useRouter } from "next/navigation";
|
||||||
|
import { useEffect, useState } from "react";
|
||||||
import { Logo } from "@/components/Logo";
|
import { Logo } from "@/components/Logo";
|
||||||
import { AmbientBackground } from "../login/AmbientBackground";
|
import { AmbientBackground } from "../login/AmbientBackground";
|
||||||
|
|
||||||
|
|
@ -57,8 +57,10 @@ export default function RegisterPage() {
|
||||||
|
|
||||||
// Redirect to login page after successful registration
|
// Redirect to login page after successful registration
|
||||||
router.push("/login?registered=true");
|
router.push("/login?registered=true");
|
||||||
} catch (err: any) {
|
} catch (err: unknown) {
|
||||||
setError(err.message || "An error occurred during registration");
|
const errorMessage =
|
||||||
|
err instanceof Error ? err.message : "An error occurred during registration";
|
||||||
|
setError(errorMessage);
|
||||||
} finally {
|
} finally {
|
||||||
setIsLoading(false);
|
setIsLoading(false);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,11 @@
|
||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import React from "react";
|
import { ArrowLeft, Bot, Brain, Settings } from "lucide-react"; // Import ArrowLeft icon
|
||||||
import { useRouter } from "next/navigation"; // Add this import
|
import { useRouter } from "next/navigation"; // Add this import
|
||||||
import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs";
|
|
||||||
import { Separator } from "@/components/ui/separator";
|
|
||||||
import { Bot, Settings, Brain, ArrowLeft } from "lucide-react"; // Import ArrowLeft icon
|
|
||||||
import { ModelConfigManager } from "@/components/settings/model-config-manager";
|
|
||||||
import { LLMRoleManager } from "@/components/settings/llm-role-manager";
|
import { LLMRoleManager } from "@/components/settings/llm-role-manager";
|
||||||
|
import { ModelConfigManager } from "@/components/settings/model-config-manager";
|
||||||
|
import { Separator } from "@/components/ui/separator";
|
||||||
|
import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs";
|
||||||
|
|
||||||
export default function SettingsPage() {
|
export default function SettingsPage() {
|
||||||
const router = useRouter(); // Initialize router
|
const router = useRouter(); // Initialize router
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue