diff --git a/surfsense_web/app/dashboard/[search_space_id]/more-pages/page.tsx b/surfsense_web/app/dashboard/[search_space_id]/more-pages/page.tsx new file mode 100644 index 000000000..000163814 --- /dev/null +++ b/surfsense_web/app/dashboard/[search_space_id]/more-pages/page.tsx @@ -0,0 +1,127 @@ +"use client"; + +import { ExternalLink, Gift, Mail, Star, MessageSquarePlus, Share2, Check } from "lucide-react"; +import { motion } from "motion/react"; +import Link from "next/link"; +import { useState, useCallback } from "react"; +import { Button } from "@/components/ui/button"; +import { Card, CardContent } from "@/components/ui/card"; +import { Separator } from "@/components/ui/separator"; +import { cn } from "@/lib/utils"; + +const GITHUB_REPO_URL = "https://github.com/MODSetter/SurfSense"; + +const INITIAL_TASKS = [ + { + id: "star", + title: "Star the repository", + reward: 100, + href: GITHUB_REPO_URL, + icon: Star, + }, + { + id: "issue", + title: "Create an issue", + reward: 50, + href: `${GITHUB_REPO_URL}/issues/new/choose`, + icon: MessageSquarePlus, + }, + { + id: "share", + title: "Share on social media", + reward: 50, + href: `https://twitter.com/intent/tweet?text=Check out SurfSense - an AI-powered personal knowledge base!&url=${encodeURIComponent(GITHUB_REPO_URL)}`, + icon: Share2, + }, +] as const; + +export default function FreePagesPage() { + const [completedIds, setCompletedIds] = useState>(new Set()); + + const handleTaskClick = useCallback((taskId: string) => { + setCompletedIds((prev) => new Set(prev).add(taskId)); + }, []); + + const allCompleted = completedIds.size === INITIAL_TASKS.length; + + return ( +
+ + {/* Header */} +
+ +

Get Pages

+

+ Complete tasks to get free additional pages +

+
+ + {/* Tasks */} +
+ {INITIAL_TASKS.map((task) => { + const isCompleted = completedIds.has(task.id); + const Icon = task.icon; + return ( + + +
+ {isCompleted ? : } +
+
+

+ {task.title} +

+

+{task.reward} pages

+
+ +
+
+ ); + })} +
+ + {/* Contact */} + +
+

+ {allCompleted ? "All done! Need more?" : "Need more pages?"} +

+ +
+
+
+ ); +} diff --git a/surfsense_web/components/contact/contact-form.tsx b/surfsense_web/components/contact/contact-form.tsx index 368f40c4b..6d50388b0 100644 --- a/surfsense_web/components/contact/contact-form.tsx +++ b/surfsense_web/components/contact/contact-form.tsx @@ -1,104 +1,55 @@ "use client"; -import { zodResolver } from "@hookform/resolvers/zod"; -import { IconMailFilled } from "@tabler/icons-react"; +import { IconCalendar, IconMailFilled } from "@tabler/icons-react"; import { motion } from "motion/react"; import Image from "next/image"; import Link from "next/link"; import type React from "react"; -import { useId, useState } from "react"; -import { useForm } from "react-hook-form"; -import { toast } from "sonner"; -import { z } from "zod"; +import { useId } from "react"; import { cn } from "@/lib/utils"; -// Define validation schema matching the database schema -const contactFormSchema = z.object({ - name: z.string().min(1, "Name is required").max(255, "Name is too long"), - email: z.email("Invalid email address").max(255, "Email is too long"), - company: z.string().min(1, "Company is required").max(255, "Company name is too long"), - message: z.string().optional().prefault(""), -}); - -type ContactFormData = z.infer; - export function ContactFormGridWithDetails() { - const [isSubmitting, setIsSubmitting] = useState(false); - - const { - register, - handleSubmit, - formState: { errors }, - reset, - } = useForm({ - resolver: zodResolver(contactFormSchema), - }); - - const onSubmit = async (data: ContactFormData) => { - setIsSubmitting(true); - - try { - const response = await fetch("/api/contact", { - method: "POST", - headers: { - "Content-Type": "application/json", - }, - body: JSON.stringify(data), - }); - - const result = await response.json(); - - if (response.ok) { - toast.success("Message sent successfully!", { - description: "We will get back to you as soon as possible.", - }); - reset(); - } else { - toast.error("Failed to send message", { - description: result.message || "Please try again later.", - }); - } - } catch (error) { - console.error("Error submitting form:", error); - toast.error("Something went wrong", { - description: "Please try again later.", - }); - } finally { - setIsSubmitting(false); - } - }; - return ( -
-
+
+
-

+

Contact

-

- We'd love to Hear From You. +

+ We'd love to hear from you. Schedule a meeting or send us an email.

-
+
- rohan@surfsense.com + + Schedule a Meeting -
+ +
+ + or + +
- https://cal.com/mod-surfsense + + eric@surfsense.com
-
+ +
-
- -
- - - {errors.name &&

{errors.name.message}

} -
-
- - - {errors.email &&

{errors.email.message}

} -
-
- - - {errors.company &&

{errors.company.message}

} -
-
- -