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 index 77ca38c38..6779dc5d0 100644 --- a/surfsense_web/app/dashboard/[search_space_id]/more-pages/page.tsx +++ b/surfsense_web/app/dashboard/[search_space_id]/more-pages/page.tsx @@ -2,13 +2,14 @@ import { IconCalendar, IconMailFilled } from "@tabler/icons-react"; import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query"; -import { Check, ExternalLink, Gift, Mail, Star } from "lucide-react"; +import { Check, ExternalLink, Gift, Mail, Star, Zap } from "lucide-react"; import { motion } from "motion/react"; import Link from "next/link"; import { useEffect } from "react"; import { toast } from "sonner"; +import { Badge } from "@/components/ui/badge"; import { Button } from "@/components/ui/button"; -import { Card, CardContent } from "@/components/ui/card"; +import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from "@/components/ui/card"; import { Dialog, DialogContent, @@ -33,29 +34,24 @@ import { cn } from "@/lib/utils"; export default function MorePagesPage() { const queryClient = useQueryClient(); - // Track page view on mount useEffect(() => { trackIncentivePageViewed(); }, []); - // Fetch tasks from API const { data, isLoading } = useQuery({ queryKey: ["incentive-tasks"], queryFn: () => incentiveTasksApiService.getTasks(), }); - // Mutation to complete a task const completeMutation = useMutation({ mutationFn: incentiveTasksApiService.completeTask, onSuccess: (response, taskType) => { if (response.success) { toast.success(response.message); - // Track task completion const task = data?.tasks.find((t) => t.task_type === taskType); if (task) { trackIncentiveTaskCompleted(taskType, task.pages_reward); } - // Invalidate queries to refresh data queryClient.invalidateQueries({ queryKey: ["incentive-tasks"] }); queryClient.invalidateQueries({ queryKey: ["user"] }); } @@ -72,21 +68,21 @@ export default function MorePagesPage() { } }; - const allCompleted = data?.tasks.every((t) => t.completed) ?? false; - return (
Complete tasks to earn additional pages
++ Complete tasks to earn additional pages +
{task.title}
-+{task.pages_reward} pages
++ +{task.pages_reward} pages +
- {allCompleted ? "Thanks! Need even more pages?" : "Need more pages?"} -
- + +