├── .env.example ├── .gitignore ├── .husky └── pre-commit ├── .lintstagedrc.js ├── .prettierignore ├── .prettierrc ├── LICENSE ├── README.md ├── app ├── api │ ├── questions │ │ └── route.ts │ └── solutions │ │ └── route.ts ├── components │ └── ui │ │ └── toaster.ts ├── dashboard │ └── page.tsx ├── favicon.ico ├── fonts │ ├── GeistMonoVF.woff │ └── GeistVF.woff ├── globals.css ├── layout.tsx ├── not-found.tsx ├── not-found │ └── page.tsx └── page.tsx ├── components.json ├── components ├── AnimatedImage.tsx ├── Custom404Component.tsx ├── Footer.tsx ├── LeetCodeDashboard.tsx ├── Navbar.tsx ├── QuestionsTable.tsx ├── SolutionDialog.tsx ├── TopicDropdown.tsx ├── VideoDialog.tsx ├── icons.tsx ├── magic-ui │ ├── animated-gradient-text.tsx │ ├── blur-in.tsx │ ├── dot-pattern.tsx │ ├── gradual-spacing.tsx │ ├── number-ticker.tsx │ ├── rainbow-button.tsx │ └── sparkles-text.tsx ├── mode-toggle.tsx ├── theme-provider.tsx └── ui │ ├── badge.tsx │ ├── button.tsx │ ├── card.tsx │ ├── checkbox.tsx │ ├── command.tsx │ ├── dialog.tsx │ ├── difficulty-badge.tsx │ ├── dropdown-menu.tsx │ ├── input.tsx │ ├── navigation-menu.tsx │ ├── pagination.tsx │ ├── popover.tsx │ ├── progress.tsx │ ├── scroll-area.tsx │ ├── select.tsx │ ├── skeleton.tsx │ ├── switch.tsx │ ├── table.tsx │ ├── toast.tsx │ ├── toaster.tsx │ └── tweet-grid.tsx ├── contexts └── LanguageContext.tsx ├── data ├── accenture.csv ├── accolite.csv ├── activision.csv ├── adobe.csv ├── aetion.csv ├── affinity.csv ├── affirm.csv ├── airbnb.csv ├── airtel.csv ├── akamai.csv ├── akuna-capital.csv ├── alation.csv ├── alibaba.csv ├── allincall.csv ├── alphonso.csv ├── altimetrik.csv ├── amazon.csv ├── american-express.csv ├── analytics-quotient.csv ├── appdynamics.csv ├── apple.csv ├── aqr-capital-management-llc.csv ├── arcesium.csv ├── arista-networks.csv ├── asana.csv ├── ascend.csv ├── athenahealth.csv ├── atlassian.csv ├── audible.csv ├── avalara.csv ├── baidu.csv ├── barclays.csv ├── bitgo.csv ├── blackrock.csv ├── blizzard.csv ├── bloomberg.csv ├── bolt.csv ├── bookingcom.csv ├── box.csv ├── bridgewater-associates.csv ├── bytedance.csv ├── c3-iot.csv ├── canonical.csv ├── capgemini.csv ├── capital-one.csv ├── cashfree.csv ├── cisco.csv ├── citadel.csv ├── citrix.csv ├── clari.csv ├── cloudera.csv ├── code-studio.csv ├── codeagon.csv ├── codenation.csv ├── coderbyte.csv ├── cognizant.csv ├── cohesity.csv ├── coinbase.csv ├── commvault.csv ├── coupang.csv ├── coursera.csv ├── cruise-automation.csv ├── dailyhunt.csv ├── databricks.csv ├── dataminr.csv ├── de-shaw.csv ├── dell.csv ├── deloitte.csv ├── deutsche-bank.csv ├── didi.csv ├── directi.csv ├── discord.csv ├── docusign.csv ├── doordash.csv ├── drawbridge.csv ├── dropbox.csv ├── drw.csv ├── dunzo.csv ├── duolingo.csv ├── ebay.csv ├── edabit.csv ├── electronic-arts.csv ├── epam-systems.csv ├── epic-systems.csv ├── epifi.csv ├── expedia.csv ├── facebook.csv ├── factset.csv ├── fallible.csv ├── fleetx.csv ├── flipkart.csv ├── forusall.csv ├── fourkites.csv ├── fpt.csv ├── garena.csv ├── ge-digital.csv ├── ge-healthcare.csv ├── general-electric.csv ├── gilt-groupe.csv ├── godaddy.csv ├── goldman-sachs.csv ├── google.csv ├── grab.csv ├── groupon.csv ├── gsn-games.csv ├── hbo.csv ├── helix.csv ├── honeywell.csv ├── hotstar.csv ├── houzz.csv ├── hrt.csv ├── huawei.csv ├── hudson-river-trading.csv ├── hulu.csv ├── ibm.csv ├── iit-bombay.csv ├── indeed.csv ├── info-edge.csv ├── infosys.csv ├── inmobi.csv ├── instacart.csv ├── instagram.csv ├── intel.csv ├── intuit.csv ├── ixl.csv ├── jane-street.csv ├── jeavio.csv ├── jingchi.csv ├── jpmorgan.csv ├── jump-trading.csv ├── juspay.csv ├── kakao.csv ├── karat.csv ├── leap-motion.csv ├── lending-club.csv ├── linkedin.csv ├── liveramp.csv ├── lowe.csv ├── lucid.csv ├── lyft.csv ├── machine-zone.csv ├── machinezone.csv ├── makemytrip.csv ├── maq-software.csv ├── mathworks.csv ├── medianet.csv ├── mercari.csv ├── microsoft.csv ├── mindtickle.csv ├── mindtree.csv ├── mishipay.csv ├── mobisy.csv ├── moengage.csv ├── morgan-stanley.csv ├── myntra.csv ├── nagarro.csv ├── national-instruments.csv ├── netease.csv ├── netflix.csv ├── netsuite.csv ├── nextjump.csv ├── nutanix.csv ├── nvidia.csv ├── opendoor.csv ├── opentext.csv ├── optum.csv ├── oracle.csv ├── palantir-technologies.csv ├── paypal.csv ├── paypay.csv ├── paytm.csv ├── payu.csv ├── persistent-systems.csv ├── phonepe.csv ├── pickrr.csv ├── pinterest.csv ├── pocket-gems.csv ├── point72.csv ├── ponyai.csv ├── poshmark.csv ├── postmates.csv ├── poynt.csv ├── pure-storage.csv ├── qualcomm.csv ├── qualtrics.csv ├── quince.csv ├── quip.csv ├── quora.csv ├── rackspace.csv ├── radius.csv ├── razorpay.csv ├── reddit.csv ├── redfin.csv ├── retailmenot.csv ├── riot-games.csv ├── robinhood.csv ├── roblox.csv ├── rubrik.csv ├── salesforce.csv ├── samsung.csv ├── sap.csv ├── sapient.csv ├── servicenow.csv ├── sharechat.csv ├── shopee.csv ├── siemens.csv ├── snapchat.csv ├── snapdeal.csv ├── societe-generale.csv ├── softwire.csv ├── sony.csv ├── soundhound.csv ├── splunk.csv ├── spotify.csv ├── sprinklr.csv ├── square.csv ├── strava.csv ├── sumologic.csv ├── swiggy.csv ├── t-mobiles.csv ├── t-system.csv ├── tableau.csv ├── tcs.csv ├── tencent.csv ├── tesla.csv ├── thomson-reuters.csv ├── tiaa.csv ├── tiger-analytics.csv ├── tiktok.csv ├── toptal.csv ├── trilogy.csv ├── tripadvisor.csv ├── triplebyte.csv ├── tusimple.csv ├── twilio.csv ├── twitch.csv ├── twitter.csv ├── two-sigma.csv ├── uber.csv ├── united-health-group.csv ├── valve.csv ├── veritas.csv ├── vimeo.csv ├── virtu.csv ├── visa.csv ├── vmware.csv ├── walmart-labs.csv ├── warnermedia.csv ├── wayfair.csv ├── wayve.csv ├── wealthfront.csv ├── wish.csv ├── wix.csv ├── works-applications.csv ├── xing.csv ├── yahoo.csv ├── yandex.csv ├── yatra.csv ├── yelp.csv ├── zappos.csv ├── zenefits.csv ├── zeta-suite.csv ├── zillow.csv ├── zoho.csv ├── zomato.csv ├── zoom.csv ├── zopsmart.csv ├── zscaler.csv └── zynga.csv ├── hooks └── use-toast.ts ├── lib └── utils.ts ├── mappings └── videoMappings.ts ├── middleware.ts ├── next.config.ts ├── package.json ├── pnpm-lock.yaml ├── postcss.config.mjs ├── public ├── dm-1.jpg ├── dm-2.jpg ├── dm-3.jpg ├── file.svg ├── globe.svg ├── icon.svg ├── image.webp ├── next.svg ├── vercel.svg └── window.svg ├── tailwind.config.ts ├── tsconfig.json └── utils ├── questionTracking.ts └── utils.ts /.env.example: -------------------------------------------------------------------------------- 1 | CLERK_SECRET_KEY= 2 | GEMINI_API_KEY= 3 | NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY= -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | /.pnp 6 | .pnp.* 7 | .yarn/* 8 | !.yarn/patches 9 | !.yarn/plugins 10 | !.yarn/releases 11 | !.yarn/versions 12 | .cursorrules 13 | 14 | # testing 15 | /coverage 16 | 17 | # next.js 18 | /.next/ 19 | /out/ 20 | 21 | # production 22 | /build 23 | 24 | # misc 25 | .DS_Store 26 | *.pem 27 | 28 | # debug 29 | npm-debug.log* 30 | yarn-debug.log* 31 | yarn-error.log* 32 | 33 | # env files (can opt-in for committing if needed) 34 | .env 35 | 36 | # vercel 37 | .vercel 38 | 39 | # typescript 40 | *.tsbuildinfo 41 | next-env.d.ts 42 | -------------------------------------------------------------------------------- /.husky/pre-commit: -------------------------------------------------------------------------------- 1 | npx lint-staged -------------------------------------------------------------------------------- /.lintstagedrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | "*.{js,jsx,ts,tsx,json,css,scss,md}": ["prettier --write"], 3 | }; 4 | -------------------------------------------------------------------------------- /.prettierignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | dist 3 | dist-ssr 4 | *.local 5 | .vscode 6 | .idea 7 | .DS_Store 8 | *.suo 9 | *.ntvs* 10 | *.njsproj 11 | *.sln 12 | *.sw? -------------------------------------------------------------------------------- /.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "semi": true, 3 | "singleQuote": false, 4 | "printWidth": 100, 5 | "tabWidth": 2, 6 | "useTabs": false, 7 | "trailingComma": "es5", 8 | "bracketSpacing": true, 9 | "arrowParens": "always", 10 | "endOfLine": "lf" 11 | } 12 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## Will Update Soon 2 | 3 | [](https://api.gitsponsors.com/api/badge/link?p=avu8PEBqeodNoj/Hp8y9knBOiyzvEoPmzb+4dQrnHuxXrqqE6eIioiDuQ75gFUoAHbXSv9FJg1BIruoDdOmGmqcRCXM/8ZWALMr7QWO9FiSEaJo0iOsb8pXXcqq2jWvlywpIOymJcrIJ2CSX0dwYfQ==) 4 | -------------------------------------------------------------------------------- /app/api/questions/route.ts: -------------------------------------------------------------------------------- 1 | import { NextResponse } from "next/server"; 2 | import { promises as fs } from "fs"; 3 | import path from "path"; 4 | import { parse } from "csv-parse/sync"; 5 | 6 | interface QuestionRecord { 7 | company: string; 8 | [key: string]: string; 9 | } 10 | 11 | export async function GET() { 12 | try { 13 | const dataDirectory = path.join(process.cwd(), "data"); 14 | const files = await fs.readdir(dataDirectory); 15 | 16 | let allQuestions: QuestionRecord[] = []; 17 | 18 | for (const file of files) { 19 | if (file.endsWith(".csv")) { 20 | const company = file.replace(".csv", ""); 21 | const filePath = path.join(dataDirectory, file); 22 | const fileContent = await fs.readFile(filePath, "utf-8"); 23 | const records: Record[] = parse(fileContent, { 24 | columns: true, 25 | skip_empty_lines: true, 26 | }); 27 | 28 | const companyRecords: QuestionRecord[] = records.map((record) => ({ 29 | ...record, 30 | company, 31 | })); 32 | 33 | allQuestions = [...allQuestions, ...companyRecords]; 34 | } 35 | } 36 | 37 | const companies = [...new Set(allQuestions.map((q) => q.company))]; 38 | 39 | return NextResponse.json({ 40 | questions: allQuestions, 41 | companies: companies, 42 | }); 43 | } catch (error) { 44 | return NextResponse.json({ error: "Failed to load questions" }, { status: 500 }); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /app/api/solutions/route.ts: -------------------------------------------------------------------------------- 1 | import { GoogleGenerativeAI, GenerativeModel } from "@google/generative-ai"; 2 | import { NextResponse } from "next/server"; 3 | import { Headers } from "node-fetch"; 4 | 5 | export async function GET(request: Request) { 6 | try { 7 | const { searchParams } = new URL(request.url); 8 | const id = searchParams.get("id"); 9 | const language = searchParams.get("language") || "cpp"; 10 | 11 | if (!id) { 12 | return NextResponse.json({ error: "Question ID is required" }, { status: 400 }); 13 | } 14 | 15 | if (!process.env.GEMINI_API_KEY) { 16 | throw new Error("GEMINI_API_KEY is not configured"); 17 | } 18 | 19 | const apiKey = new Headers(request.headers).get("x-gemini-key") || process.env.GEMINI_API_KEY; 20 | if (!apiKey) { 21 | throw new Error("GEMINI_API_KEY is not configured"); 22 | } 23 | const genAI = new GoogleGenerativeAI(apiKey); 24 | 25 | const model: GenerativeModel = genAI.getGenerativeModel({ 26 | model: "gemini-1.5-flash", 27 | }); 28 | 29 | const getLanguageSpecificInstructions = (language: string): string => { 30 | switch (language.toLowerCase()) { 31 | case "cpp": 32 | return "Generate answer using namespace std. Do not mention the library imports and 'using namespace std;' at top and"; 33 | default: 34 | return ""; 35 | } 36 | }; 37 | 38 | const languageInstructions = getLanguageSpecificInstructions(language); 39 | const prompt = `${languageInstructions} provide the solution (in ${language.toUpperCase()}) without any comments for LeetCode problem #${id}.`; 40 | 41 | const result = await model.generateContent(prompt); 42 | const solution = result?.response?.text?.(); 43 | 44 | if (!solution) { 45 | throw new Error("No solution generated or invalid response structure"); 46 | } 47 | 48 | return NextResponse.json({ solution }); 49 | } catch (error: any) { 50 | console.error("API Error:", error.message || error); 51 | const message = error.message || "An unknown error occurred while generating the solution"; 52 | return NextResponse.json({ error: message }, { status: 500 }); 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /app/components/ui/toaster.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ayush-that/codejeet/eb2b2b61ed2ce1834f564195c46ab20a78b6c40b/app/components/ui/toaster.ts -------------------------------------------------------------------------------- /app/dashboard/page.tsx: -------------------------------------------------------------------------------- 1 | "use client"; 2 | 3 | import { useEffect, useState } from "react"; 4 | import LeetCodeDashboard from "@/components/LeetCodeDashboard"; 5 | import { useAuth } from "@clerk/nextjs"; 6 | import { useRouter } from "next/navigation"; 7 | 8 | export default function DashboardPage() { 9 | const { userId } = useAuth(); 10 | const router = useRouter(); 11 | 12 | const [questions, setQuestions] = useState([]); 13 | const [companies, setCompanies] = useState([]); 14 | const [loading, setLoading] = useState(true); 15 | 16 | useEffect(() => { 17 | if (userId) { 18 | fetch("/api/questions") 19 | .then((res) => res.json()) 20 | .then((data) => { 21 | setQuestions(data.questions); 22 | setCompanies(data.companies); 23 | setLoading(false); 24 | }) 25 | .catch((error) => { 26 | console.error("Error loading questions:", error); 27 | setLoading(false); 28 | }); 29 | } 30 | }, [userId]); 31 | 32 | useEffect(() => { 33 | if (!userId && !loading) { 34 | router.push("/"); 35 | } 36 | }, [userId, loading, router]); 37 | 38 | if (loading || !userId) { 39 | return ( 40 |
41 |
42 |
43 |
44 | {[...Array(4)].map((_, i) => ( 45 |
46 | ))} 47 |
48 |
49 |
50 |
51 | ); 52 | } 53 | 54 | return ( 55 |
56 | 57 |
58 | ); 59 | } 60 | -------------------------------------------------------------------------------- /app/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ayush-that/codejeet/eb2b2b61ed2ce1834f564195c46ab20a78b6c40b/app/favicon.ico -------------------------------------------------------------------------------- /app/fonts/GeistMonoVF.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ayush-that/codejeet/eb2b2b61ed2ce1834f564195c46ab20a78b6c40b/app/fonts/GeistMonoVF.woff -------------------------------------------------------------------------------- /app/fonts/GeistVF.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ayush-that/codejeet/eb2b2b61ed2ce1834f564195c46ab20a78b6c40b/app/fonts/GeistVF.woff -------------------------------------------------------------------------------- /app/globals.css: -------------------------------------------------------------------------------- 1 | @tailwind base; 2 | @tailwind components; 3 | @tailwind utilities; 4 | 5 | :root { 6 | --color-1: 0 100% 63%; 7 | --color-2: 270 100% 63%; 8 | --color-3: 210 100% 63%; 9 | --color-4: 195 100% 63%; 10 | --color-5: 90 100% 63%; 11 | --font-poppins: "Poppins", sans-serif; 12 | } 13 | 14 | .rainbow-button { 15 | background: linear-gradient( 16 | to right, 17 | hsl(var(--color-1)), 18 | hsl(var(--color-2)), 19 | hsl(var(--color-3)), 20 | hsl(var(--color-4)), 21 | hsl(var(--color-5)) 22 | ); 23 | background-size: 200% 100%; 24 | animation: rainbow 5s linear infinite; 25 | } 26 | 27 | @keyframes rainbow { 28 | 0% { 29 | background-position: 0% 50%; 30 | } 31 | 32 | 100% { 33 | background-position: 200% 50%; 34 | } 35 | } 36 | 37 | @layer base { 38 | :root { 39 | --background: 237 100% 95%; 40 | --foreground: 237 5% 10%; 41 | --card: 237 50% 90%; 42 | --card-foreground: 237 5% 15%; 43 | --popover: 237 100% 95%; 44 | --popover-foreground: 237 100% 10%; 45 | --primary: 237 23.2% 36.3%; 46 | --primary-foreground: 0 0% 100%; 47 | --secondary: 237 30% 70%; 48 | --secondary-foreground: 0 0% 0%; 49 | --muted: 199 30% 85%; 50 | --muted-foreground: 237 5% 35%; 51 | --accent: 199 30% 80%; 52 | --accent-foreground: 237 5% 15%; 53 | --destructive: 0 100% 30%; 54 | --destructive-foreground: 237 5% 90%; 55 | --border: 237 30% 50%; 56 | --input: 237 30% 26%; 57 | --ring: 237 23.2% 36.3%; 58 | --radius: 0.5rem; 59 | } 60 | 61 | .dark { 62 | --background: 237 50% 10%; 63 | --foreground: 237 5% 90%; 64 | --card: 237 50% 10%; 65 | --card-foreground: 237 5% 90%; 66 | --popover: 237 50% 5%; 67 | --popover-foreground: 237 5% 90%; 68 | --primary: 237 23.2% 36.3%; 69 | --primary-foreground: 0 0% 100%; 70 | --secondary: 237 30% 20%; 71 | --secondary-foreground: 0 0% 100%; 72 | --muted: 199 30% 25%; 73 | --muted-foreground: 237 5% 60%; 74 | --accent: 199 30% 25%; 75 | --accent-foreground: 237 5% 90%; 76 | --destructive: 0 100% 30%; 77 | --destructive-foreground: 237 5% 90%; 78 | --border: 237 30% 26%; 79 | --input: 237 30% 26%; 80 | --ring: 237 23.2% 36.3%; 81 | --radius: 0.5rem; 82 | } 83 | } 84 | 85 | @layer base { 86 | * { 87 | @apply border-border; 88 | } 89 | 90 | body { 91 | @apply bg-background text-foreground; 92 | } 93 | } 94 | -------------------------------------------------------------------------------- /app/layout.tsx: -------------------------------------------------------------------------------- 1 | import { Poppins } from "next/font/google"; 2 | import { ThemeProvider } from "@/components/theme-provider"; 3 | import Navbar from "@/components/Navbar"; 4 | import Footer from "@/components/Footer"; 5 | import { Toaster } from "@/components/ui/toaster"; 6 | import "./globals.css"; 7 | import { Analytics } from "@vercel/analytics/react"; 8 | import { ClerkProvider } from "@clerk/nextjs"; 9 | import { dark } from "@clerk/themes"; 10 | import { LanguageProvider } from "@/contexts/LanguageContext"; 11 | 12 | const font = Poppins({ 13 | subsets: ["latin"], 14 | weight: ["100", "200", "300", "400", "500", "600", "700", "800", "900"], 15 | }); 16 | 17 | export default function RootLayout({ children }: { children: React.ReactNode }) { 18 | return ( 19 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 36 |
37 | 38 |
{children}
39 |
40 | 41 | 42 |
43 |
44 |
45 | 46 | 47 |
48 | ); 49 | } 50 | -------------------------------------------------------------------------------- /app/not-found.tsx: -------------------------------------------------------------------------------- 1 | import Custom404Component from "@/components/Custom404Component"; 2 | 3 | export default function NotFound() { 4 | return ; 5 | } 6 | -------------------------------------------------------------------------------- /app/not-found/page.tsx: -------------------------------------------------------------------------------- 1 | "use client"; 2 | 3 | import React, { Suspense } from "react"; 4 | import Custom404Component from "@/components/Custom404Component"; 5 | 6 | export default function NotFound() { 7 | return ( 8 |
9 |

404 - Page Not Found

10 |

Sorry, the page you are looking for does not exist.

11 | Loading additional information...
}> 12 | 13 | 14 |
15 | ); 16 | } 17 | -------------------------------------------------------------------------------- /components.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://ui.shadcn.com/schema.json", 3 | "style": "new-york", 4 | "rsc": true, 5 | "tsx": true, 6 | "tailwind": { 7 | "config": "tailwind.config.ts", 8 | "css": "app/globals.css", 9 | "baseColor": "neutral", 10 | "cssVariables": true, 11 | "prefix": "" 12 | }, 13 | "aliases": { 14 | "components": "@/components", 15 | "utils": "@/lib/utils", 16 | "ui": "@/components/ui", 17 | "lib": "@/lib", 18 | "hooks": "@/hooks" 19 | }, 20 | "iconLibrary": "lucide" 21 | } 22 | -------------------------------------------------------------------------------- /components/AnimatedImage.tsx: -------------------------------------------------------------------------------- 1 | "use client"; 2 | 3 | import React from "react"; 4 | import Image from "next/image"; 5 | import { motion, useMotionValue, useTransform, useSpring } from "framer-motion"; 6 | import { cn } from "@/lib/utils"; 7 | 8 | interface AnimatedImageProps { 9 | src: string; 10 | alt: string; 11 | width: number; 12 | height: number; 13 | className?: string; 14 | } 15 | 16 | const AnimatedImage: React.FC = ({ src, alt, width, height, className }) => { 17 | const x = useMotionValue(0); 18 | const y = useMotionValue(0); 19 | 20 | const springConfig = { stiffness: 300, damping: 30 }; 21 | const rotateX = useSpring(useTransform(y, [-300, 300], [5, -5]), springConfig); 22 | const rotateY = useSpring(useTransform(x, [-300, 300], [-5, 5]), springConfig); 23 | 24 | const handleMouseMove = (event: React.MouseEvent) => { 25 | const rect = event.currentTarget.getBoundingClientRect(); 26 | const centerX = rect.left + rect.width / 2; 27 | const centerY = rect.top + rect.height / 2; 28 | x.set(event.clientX - centerX); 29 | y.set(event.clientY - centerY); 30 | }; 31 | 32 | const handleMouseLeave = () => { 33 | x.set(0, true); 34 | y.set(0, true); 35 | }; 36 | 37 | return ( 38 | 44 | 53 |
54 |
55 |
56 | {alt} 68 |
69 | 70 | 71 | ); 72 | }; 73 | 74 | export default AnimatedImage; 75 | -------------------------------------------------------------------------------- /components/Custom404Component.tsx: -------------------------------------------------------------------------------- 1 | "use client"; 2 | 3 | import React, { Suspense } from "react"; 4 | import { useSearchParams } from "next/navigation"; 5 | 6 | const SearchParamsContent: React.FC = () => { 7 | const searchParams = useSearchParams(); 8 | const referrer = searchParams?.get("ref"); 9 | 10 | return ( 11 | <> 12 | {referrer ? ( 13 |

Oops! It seems like there was an issue coming from {referrer}.

14 | ) : ( 15 |

It looks like nothing was found at this location.

16 | )} 17 | 18 | ); 19 | }; 20 | 21 | const Custom404Component: React.FC = () => { 22 | return ( 23 |
24 | Loading...

}> 25 | 26 |
27 |
28 | ); 29 | }; 30 | 31 | export default Custom404Component; 32 | -------------------------------------------------------------------------------- /components/Footer.tsx: -------------------------------------------------------------------------------- 1 | import { BsTwitterX, BsSuitHeartFill } from "react-icons/bs"; 2 | 3 | const Footer = () => { 4 | return ( 5 |
6 |
7 | {/* Left Side */} 8 |
9 | 10 | Built with 11 | by Ayush 12 | 13 |
14 | {/* Right Side */} 15 |
16 | 17 | 18 | 19 |
20 |
21 |
22 | ); 23 | }; 24 | 25 | export default Footer; 26 | -------------------------------------------------------------------------------- /components/QuestionsTable.tsx: -------------------------------------------------------------------------------- 1 | import { 2 | Table, 3 | TableBody, 4 | TableCell, 5 | TableHead, 6 | TableHeader, 7 | TableRow, 8 | } from "@/components/ui/table"; 9 | import { VideoDialog } from "./VideoDialog"; 10 | 11 | interface Question { 12 | id: string; 13 | title: string; 14 | url: string; 15 | isPremium: boolean; 16 | acceptance: string; 17 | difficulty: string; 18 | frequency: string; 19 | } 20 | 21 | export function QuestionsTable({ questions }: { questions: Question[] }) { 22 | return ( 23 | 24 | 25 | 26 | ID 27 | Title 28 | Difficulty 29 | Acceptance 30 | Video 31 | 32 | 33 | 34 | {questions.map((question) => ( 35 | 36 | {question.id} 37 | {question.title} 38 | {question.difficulty} 39 | {question.acceptance} 40 | 41 | 42 | 43 | 44 | ))} 45 | 46 |
47 | ); 48 | } 49 | -------------------------------------------------------------------------------- /components/VideoDialog.tsx: -------------------------------------------------------------------------------- 1 | "use client"; 2 | 3 | import React from "react"; 4 | import { Button } from "@/components/ui/button"; 5 | import { Dialog, DialogContent, DialogHeader, DialogTitle } from "@/components/ui/dialog"; 6 | import { Youtube } from "lucide-react"; 7 | import { videoMappings } from "@/mappings/videoMappings"; 8 | 9 | interface VideoDialogProps { 10 | id: string; 11 | title: string; 12 | } 13 | 14 | export function VideoDialog({ id, title }: VideoDialogProps) { 15 | const [open, setOpen] = React.useState(false); 16 | 17 | const getVideoUrl = (problemId: string) => { 18 | return videoMappings[problemId] || "dQw4w9WgXcQ"; 19 | }; 20 | 21 | return ( 22 | <> 23 | 26 | 27 | 28 | 29 | 30 | {title} - Video Solution 31 | 32 |
33 |