diff --git a/app/protected/help/page.tsx b/app/protected/help/page.tsx new file mode 100644 index 00000000..eda45c57 --- /dev/null +++ b/app/protected/help/page.tsx @@ -0,0 +1,356 @@ +'use client' + +import React, { useState } from 'react' +import { Input } from '@/components/ui/input' +import { Button } from '@/components/ui/button' +import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui/card' +import { Accordion, AccordionContent, AccordionItem, AccordionTrigger } from '@/components/ui/accordion' +import { + Search, + HelpCircle, + Mail, + MessageSquare, + BookOpen, + Settings, + Shield, + Users, + Trophy, + Calendar, + Code, + AlertCircle, + CheckCircle, + Clock, + ExternalLink +} from 'lucide-react' + +const quickActions = [ + { icon: Shield, title: 'Reset Password', description: 'Change your account password', href: '/protected/settings' }, + { icon: Users, title: 'Update Profile', description: 'Edit your profile information', href: '/protected/profile/view' }, + { icon: Mail, title: 'Contact Support', description: 'Get help from our team', action: 'contact' }, + { icon: AlertCircle, title: 'Report a Bug', description: 'Help us improve the platform', action: 'bug' }, +] + +const faqCategories = [ + { + title: 'Getting Started', + icon: BookOpen, + faqs: [ + { + question: 'How do I complete my profile?', + answer: 'Go to your profile page by clicking on your avatar in the sidebar, then click "Edit Profile". Fill in all required fields including your bio, skills, and education details.' + }, + { + question: 'How do I navigate the platform?', + answer: 'Use the sidebar on the left to access different sections. On mobile, tap the menu icon in the top-left corner. The dashboard gives you an overview of all your activities.' + }, + { + question: 'What are the main features available?', + answer: 'Codeunia offers courses, assignments, tests, hackathons, events, messaging, connections, study groups, mentorship, and career opportunities all in one platform.' + } + ] + }, + { + title: 'Courses & Learning', + icon: BookOpen, + faqs: [ + { + question: 'How do I enroll in a course?', + answer: 'Navigate to "My Courses" from the sidebar, browse available courses, and click "Enroll" on any course you\'re interested in. Some courses may have prerequisites.' + }, + { + question: 'Where can I find my assignments?', + answer: 'All your assignments are listed in the "Assignments" section. You can filter by course, due date, or status (pending, submitted, graded).' + }, + { + question: 'How do I submit an assignment?', + answer: 'Open the assignment, complete the required work, and click "Submit". You can attach files, add links, or write text responses depending on the assignment type.' + } + ] + }, + { + title: 'Tests & Assessments', + icon: Trophy, + faqs: [ + { + question: 'How do I take a test?', + answer: 'Go to "Test Dashboard" or "Browse Tests", select a test, and click "Start Test". Make sure you have a stable internet connection and enough time to complete it.' + }, + { + question: 'Can I retake a test?', + answer: 'It depends on the test settings. Some tests allow multiple attempts while others are one-time only. Check the test details before starting.' + }, + { + question: 'Where can I see my test results?', + answer: 'Your test results are available in "Grades & Progress" section. You can view detailed feedback, correct answers, and your performance analytics.' + } + ] + }, + { + title: 'Messages & Connections', + icon: MessageSquare, + faqs: [ + { + question: 'How do I send a message?', + answer: 'Go to the Messages section, click "New Message", search for the person you want to message, and start chatting. You can also message from their profile.' + }, + { + question: 'How do I add connections?', + answer: 'Visit the Connections page, use the search tab to find users, and click "Follow" on their profile. They can follow you back to create a mutual connection.' + }, + { + question: 'Can I create group chats?', + answer: 'Yes! In the Messages section, click "New Message" and select multiple recipients to create a group conversation.' + } + ] + }, + { + title: 'Events & Activities', + icon: Calendar, + faqs: [ + { + question: 'How do I join a hackathon?', + answer: 'Browse available hackathons in the "Hackathons" section, read the details, and click "Register". You can participate individually or as a team.' + }, + { + question: 'How do I register for events?', + answer: 'Go to "Events & Workshops", find an event you\'re interested in, and click "Register". You\'ll receive confirmation and reminders via email.' + }, + { + question: 'Can I create my own project?', + answer: 'Yes! Visit the "Projects" section and click "Create Project". Add details, invite collaborators, and showcase your work to the community.' + } + ] + }, + { + title: 'Technical Issues', + icon: Code, + faqs: [ + { + question: 'I can\'t log in to my account', + answer: 'Try resetting your password using the "Forgot Password" link. If that doesn\'t work, clear your browser cache or try a different browser. Contact support if the issue persists.' + }, + { + question: 'The page is loading slowly', + answer: 'Check your internet connection. Try refreshing the page or clearing your browser cache. If the issue continues, it might be temporary server maintenance.' + }, + { + question: 'I\'m not receiving email notifications', + answer: 'Check your spam folder. Verify your email address in Settings. Make sure notifications are enabled in your account preferences.' + } + ] + }, + { + title: 'Account & Settings', + icon: Settings, + faqs: [ + { + question: 'How do I change my password?', + answer: 'Go to Settings, click on "Security", and select "Change Password". Enter your current password and your new password twice to confirm.' + }, + { + question: 'How do I manage notifications?', + answer: 'Visit Settings > Notifications to customize which notifications you receive via email, push, or in-app alerts.' + }, + { + question: 'Can I delete my account?', + answer: 'Yes, but this action is permanent. Go to Settings > Account > Delete Account. You\'ll need to confirm this action and all your data will be removed.' + } + ] + } +] + +export default function HelpPage() { + const [searchQuery, setSearchQuery] = useState('') + const [filteredFaqs, setFilteredFaqs] = useState(faqCategories) + + const handleSearch = (query: string) => { + setSearchQuery(query) + + if (!query.trim()) { + setFilteredFaqs(faqCategories) + return + } + + const filtered = faqCategories.map(category => ({ + ...category, + faqs: category.faqs.filter(faq => + faq.question.toLowerCase().includes(query.toLowerCase()) || + faq.answer.toLowerCase().includes(query.toLowerCase()) + ) + })).filter(category => category.faqs.length > 0) + + setFilteredFaqs(filtered) + } + + return ( +
+ {/* Header */} +
+
+
+
+ +
+

Help Center

+
+

+ Find answers to common questions or get in touch with our support team +

+
+
+ + {/* Main Content */} +
+
+ {/* Search Bar */} +
+ + handleSearch(e.target.value)} + className="pl-10 h-12 bg-zinc-900 border-zinc-800 text-white placeholder:text-zinc-500 focus:border-blue-500 focus:ring-blue-500" + /> +
+ + {/* Quick Actions */} + {!searchQuery && ( +
+

Quick Actions

+
+ {quickActions.map((action, index) => ( + + +
+
+ +
+
+ {action.title} + + {action.description} + +
+
+
+
+ ))} +
+
+ )} + + {/* FAQ Categories */} +
+

+ {searchQuery ? 'Search Results' : 'Frequently Asked Questions'} +

+ + {filteredFaqs.length === 0 ? ( + + + +

No results found

+

Try different keywords or contact support

+
+
+ ) : ( +
+ {filteredFaqs.map((category, categoryIndex) => ( + + +
+
+ +
+ {category.title} +
+
+ + + {category.faqs.map((faq, faqIndex) => ( + + + {faq.question} + + + {faq.answer} + + + ))} + + +
+ ))} +
+ )} +
+ + {/* Contact Support Section */} + {!searchQuery && ( + + + + + Still Need Help? + + + Our support team is here to assist you + + + +
+ +
+

Email Support

+

support@codeunia.com

+

Response time: 24-48 hours

+
+
+
+ +
+

Support Hours

+

Monday - Friday: 9:00 AM - 6:00 PM IST

+

Saturday: 10:00 AM - 4:00 PM IST

+
+
+ +
+
+ )} + + {/* System Status */} + {!searchQuery && ( + + + + + System Status + + + +
+
+

All Systems Operational

+

Last checked: Just now

+
+ +
+
+
+ )} +
+
+
+ ) +} diff --git a/components/ui/accordion.tsx b/components/ui/accordion.tsx new file mode 100644 index 00000000..24c788c2 --- /dev/null +++ b/components/ui/accordion.tsx @@ -0,0 +1,58 @@ +"use client" + +import * as React from "react" +import * as AccordionPrimitive from "@radix-ui/react-accordion" +import { ChevronDown } from "lucide-react" + +import { cn } from "@/lib/utils" + +const Accordion = AccordionPrimitive.Root + +const AccordionItem = React.forwardRef< + React.ElementRef, + React.ComponentPropsWithoutRef +>(({ className, ...props }, ref) => ( + +)) +AccordionItem.displayName = "AccordionItem" + +const AccordionTrigger = React.forwardRef< + React.ElementRef, + React.ComponentPropsWithoutRef +>(({ className, children, ...props }, ref) => ( + + svg]:rotate-180", + className + )} + {...props} + > + {children} + + + +)) +AccordionTrigger.displayName = AccordionPrimitive.Trigger.displayName + +const AccordionContent = React.forwardRef< + React.ElementRef, + React.ComponentPropsWithoutRef +>(({ className, children, ...props }, ref) => ( + +
{children}
+
+)) + +AccordionContent.displayName = AccordionPrimitive.Content.displayName + +export { Accordion, AccordionItem, AccordionTrigger, AccordionContent } diff --git a/package-lock.json b/package-lock.json index 97bdb4d3..91c0e61f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,6 +9,7 @@ "@dnd-kit/sortable": "^10.0.0", "@dnd-kit/utilities": "^3.2.2", "@google/generative-ai": "^0.24.1", + "@radix-ui/react-accordion": "^1.2.12", "@radix-ui/react-alert-dialog": "^1.1.15", "@radix-ui/react-avatar": "^1.1.10", "@radix-ui/react-checkbox": "^1.3.1", @@ -2530,6 +2531,43 @@ "integrity": "sha512-XnbHrrprsNqZKQhStrSwgRUQzoCI1glLzdw79xiZPoofhGICeZRSQ3dIxAKH1gb3OHfNf4d6f+vAv3kil2eggA==", "license": "MIT" }, + "node_modules/@radix-ui/react-accordion": { + "version": "1.2.12", + "resolved": "https://registry.npmjs.org/@radix-ui/react-accordion/-/react-accordion-1.2.12.tgz", + "integrity": "sha512-T4nygeh9YE9dLRPhAHSeOZi7HBXo+0kYIPJXayZfvWOWA0+n3dESrZbjfDPUABkUNym6Hd+f2IR113To8D2GPA==", + "license": "MIT", + "dependencies": { + "@radix-ui/primitive": "1.1.3", + "@radix-ui/react-collapsible": "1.1.12", + "@radix-ui/react-collection": "1.1.7", + "@radix-ui/react-compose-refs": "1.1.2", + "@radix-ui/react-context": "1.1.2", + "@radix-ui/react-direction": "1.1.1", + "@radix-ui/react-id": "1.1.1", + "@radix-ui/react-primitive": "2.1.3", + "@radix-ui/react-use-controllable-state": "1.2.2" + }, + "peerDependencies": { + "@types/react": "*", + "@types/react-dom": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", + "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + } + } + }, + "node_modules/@radix-ui/react-accordion/node_modules/@radix-ui/primitive": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/@radix-ui/primitive/-/primitive-1.1.3.tgz", + "integrity": "sha512-JTF99U/6XIjCBo0wqkU5sK10glYe27MRRsfwoiq5zzOEZLHU3A3KCMa5X/azekYRCJ0HlwI0crAXS/5dEHTzDg==", + "license": "MIT" + }, "node_modules/@radix-ui/react-alert-dialog": { "version": "1.1.15", "resolved": "https://registry.npmjs.org/@radix-ui/react-alert-dialog/-/react-alert-dialog-1.1.15.tgz", @@ -2644,6 +2682,66 @@ } } }, + "node_modules/@radix-ui/react-collapsible": { + "version": "1.1.12", + "resolved": "https://registry.npmjs.org/@radix-ui/react-collapsible/-/react-collapsible-1.1.12.tgz", + "integrity": "sha512-Uu+mSh4agx2ib1uIGPP4/CKNULyajb3p92LsVXmH2EHVMTfZWpll88XJ0j4W0z3f8NK1eYl1+Mf/szHPmcHzyA==", + "license": "MIT", + "dependencies": { + "@radix-ui/primitive": "1.1.3", + "@radix-ui/react-compose-refs": "1.1.2", + "@radix-ui/react-context": "1.1.2", + "@radix-ui/react-id": "1.1.1", + "@radix-ui/react-presence": "1.1.5", + "@radix-ui/react-primitive": "2.1.3", + "@radix-ui/react-use-controllable-state": "1.2.2", + "@radix-ui/react-use-layout-effect": "1.1.1" + }, + "peerDependencies": { + "@types/react": "*", + "@types/react-dom": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", + "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + } + } + }, + "node_modules/@radix-ui/react-collapsible/node_modules/@radix-ui/primitive": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/@radix-ui/primitive/-/primitive-1.1.3.tgz", + "integrity": "sha512-JTF99U/6XIjCBo0wqkU5sK10glYe27MRRsfwoiq5zzOEZLHU3A3KCMa5X/azekYRCJ0HlwI0crAXS/5dEHTzDg==", + "license": "MIT" + }, + "node_modules/@radix-ui/react-collapsible/node_modules/@radix-ui/react-presence": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/@radix-ui/react-presence/-/react-presence-1.1.5.tgz", + "integrity": "sha512-/jfEwNDdQVBCNvjkGit4h6pMOzq8bHkopq458dPt2lMjx+eBQUohZNG9A7DtO/O5ukSbxuaNGXMjHicgwy6rQQ==", + "license": "MIT", + "dependencies": { + "@radix-ui/react-compose-refs": "1.1.2", + "@radix-ui/react-use-layout-effect": "1.1.1" + }, + "peerDependencies": { + "@types/react": "*", + "@types/react-dom": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", + "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + } + } + }, "node_modules/@radix-ui/react-collection": { "version": "1.1.7", "resolved": "https://registry.npmjs.org/@radix-ui/react-collection/-/react-collection-1.1.7.tgz", diff --git a/package.json b/package.json index 43272b9b..98397054 100644 --- a/package.json +++ b/package.json @@ -48,6 +48,7 @@ "@dnd-kit/sortable": "^10.0.0", "@dnd-kit/utilities": "^3.2.2", "@google/generative-ai": "^0.24.1", + "@radix-ui/react-accordion": "^1.2.12", "@radix-ui/react-alert-dialog": "^1.1.15", "@radix-ui/react-avatar": "^1.1.10", "@radix-ui/react-checkbox": "^1.3.1",