From 827b59c960293fb8271c59604f2e04dd4f9f3794 Mon Sep 17 00:00:00 2001 From: Pushan T Date: Sat, 21 Jun 2025 12:12:24 +0530 Subject: [PATCH 1/2] colour changed (patanjali mode) --- hire-ai/.prettierrc | 14 +- hire-ai/app/(recruiter)/search/page.tsx | 524 +++++++++++++++++------- 2 files changed, 400 insertions(+), 138 deletions(-) diff --git a/hire-ai/.prettierrc b/hire-ai/.prettierrc index 55ea2b2..f038d71 100644 --- a/hire-ai/.prettierrc +++ b/hire-ai/.prettierrc @@ -1,4 +1,16 @@ { + "semi": true, + "trailingComma": "es5", + "singleQuote": false, + "doubleQuote": true, "tabWidth": 4, - "useTabs": false + "useTabs": false, + "printWidth": 100, + "bracketSpacing": true, + "bracketSameLine": false, + "arrowParens": "always", + "endOfLine": "crlf", + "quoteProps": "as-needed", + "jsxSingleQuote": false, + "embeddedLanguageFormatting": "auto" } diff --git a/hire-ai/app/(recruiter)/search/page.tsx b/hire-ai/app/(recruiter)/search/page.tsx index a74215d..6a6a03e 100644 --- a/hire-ai/app/(recruiter)/search/page.tsx +++ b/hire-ai/app/(recruiter)/search/page.tsx @@ -73,13 +73,13 @@ export default function SearchPage() { useEffect(() => { const loadCandidates = async () => { try { - const response = await fetch('/data/indian-candidates.json'); + const response = await fetch("/data/indian-candidates.json"); const data = await response.json(); setCandidates(data); setFilteredCandidates(data); setLoading(false); } catch (error) { - console.error('Error loading candidates:', error); + console.error("Error loading candidates:", error); setLoading(false); } }; @@ -90,112 +90,330 @@ export default function SearchPage() { // Analyze search query for detected criteria const analyzeSearchQuery = (query: string) => { const lowerQuery = query.toLowerCase(); - + // Location patterns const locationKeywords = [ - 'bangalore', 'mumbai', 'delhi', 'chennai', 'hyderabad', 'pune', 'kolkata', - 'ahmedabad', 'kochi', 'jaipur', 'mysore', 'coimbatore', 'thiruvananthapuram', - 'bay area', 'silicon valley', 'california', 'new york', 'london', 'remote', - 'gurgaon', 'noida', 'indore', 'bhubaneswar', 'chandigarh', 'nagpur', 'surat' + "bangalore", + "mumbai", + "delhi", + "chennai", + "hyderabad", + "pune", + "kolkata", + "ahmedabad", + "kochi", + "jaipur", + "mysore", + "coimbatore", + "thiruvananthapuram", + "bay area", + "silicon valley", + "california", + "new york", + "london", + "remote", + "gurgaon", + "noida", + "indore", + "bhubaneswar", + "chandigarh", + "nagpur", + "surat", ]; - + // Job title patterns - expanded for all fields const jobTitleKeywords = [ // Technology - 'engineer', 'developer', 'architect', 'devops', 'data scientist', 'ai', 'ml', + "engineer", + "developer", + "architect", + "devops", + "data scientist", + "ai", + "ml", // Product & Management - 'product manager', 'manager', 'director', 'analyst', 'lead', 'senior', 'junior', - 'principal', 'consultant', 'specialist', 'coordinator', 'executive', + "product manager", + "manager", + "director", + "analyst", + "lead", + "senior", + "junior", + "principal", + "consultant", + "specialist", + "coordinator", + "executive", // Sales & Marketing - 'sales', 'marketing', 'account', 'business development', 'growth', 'digital marketing', - 'content', 'social media', 'seo', 'sem', 'brand', 'performance marketing', + "sales", + "marketing", + "account", + "business development", + "growth", + "digital marketing", + "content", + "social media", + "seo", + "sem", + "brand", + "performance marketing", // Finance & Operations - 'financial', 'finance', 'controller', 'cfo', 'operations', 'supply chain', 'logistics', - 'audit', 'risk', 'treasury', 'budget', 'investment', 'credit', + "financial", + "finance", + "controller", + "cfo", + "operations", + "supply chain", + "logistics", + "audit", + "risk", + "treasury", + "budget", + "investment", + "credit", // HR & Legal - 'hr', 'human resources', 'talent', 'recruiter', 'recruiting', 'legal', 'counsel', - 'compliance', 'contract', 'regulatory', 'employment', 'benefits', + "hr", + "human resources", + "talent", + "recruiter", + "recruiting", + "legal", + "counsel", + "compliance", + "contract", + "regulatory", + "employment", + "benefits", // Design & Creative - 'designer', 'design', 'creative', 'ui', 'ux', 'visual', 'graphic', 'brand designer', - 'art director', 'motion graphics', 'interaction design', + "designer", + "design", + "creative", + "ui", + "ux", + "visual", + "graphic", + "brand designer", + "art director", + "motion graphics", + "interaction design", // Consulting & Strategy - 'consultant', 'strategy', 'transformation', 'process improvement', 'change management', + "consultant", + "strategy", + "transformation", + "process improvement", + "change management", // Healthcare & Education - 'healthcare', 'medical', 'clinical', 'pharmaceutical', 'training', 'learning', - 'education', 'curriculum', 'instructional' + "healthcare", + "medical", + "clinical", + "pharmaceutical", + "training", + "learning", + "education", + "curriculum", + "instructional", ]; - + // Experience patterns const experiencePatterns = [ /\d+\s*(year|yr|yrs|years?)/i, /(fresh|fresher|entry.level|junior|senior|mid.level|experienced)/i, - /(\d+)\+?\s*(year|yr|yrs|years?)/i + /(\d+)\+?\s*(year|yr|yrs|years?)/i, ]; - + // Industry patterns - greatly expanded const industryKeywords = [ // Technology - 'fintech', 'tech', 'technology', 'startup', 'saas', 'software', 'it', + "fintech", + "tech", + "technology", + "startup", + "saas", + "software", + "it", // Finance & Banking - 'finance', 'banking', 'financial services', 'insurance', 'investment', - 'private equity', 'venture capital', 'asset management', + "finance", + "banking", + "financial services", + "insurance", + "investment", + "private equity", + "venture capital", + "asset management", // Consulting & Professional Services - 'consulting', 'professional services', 'advisory', 'strategy', + "consulting", + "professional services", + "advisory", + "strategy", // Healthcare & Pharma - 'healthcare', 'pharma', 'pharmaceutical', 'medical', 'biotech', 'life sciences', + "healthcare", + "pharma", + "pharmaceutical", + "medical", + "biotech", + "life sciences", // E-commerce & Retail - 'ecommerce', 'e-commerce', 'retail', 'consumer goods', 'fmcg', + "ecommerce", + "e-commerce", + "retail", + "consumer goods", + "fmcg", // Manufacturing & Industrial - 'manufacturing', 'automotive', 'industrial', 'chemicals', 'steel', 'textiles', + "manufacturing", + "automotive", + "industrial", + "chemicals", + "steel", + "textiles", // Media & Entertainment - 'media', 'entertainment', 'gaming', 'publishing', 'advertising', 'marketing', + "media", + "entertainment", + "gaming", + "publishing", + "advertising", + "marketing", // Education & Training - 'education', 'edtech', 'training', 'learning', 'academic', + "education", + "edtech", + "training", + "learning", + "academic", // Government & Public Sector - 'government', 'public sector', 'ngo', 'non-profit', + "government", + "public sector", + "ngo", + "non-profit", // Real Estate & Construction - 'real estate', 'construction', 'infrastructure', 'property', + "real estate", + "construction", + "infrastructure", + "property", // Energy & Utilities - 'energy', 'utilities', 'oil', 'gas', 'renewable', 'solar', 'wind' + "energy", + "utilities", + "oil", + "gas", + "renewable", + "solar", + "wind", ]; - + // Skills patterns - expanded for all fields const skillKeywords = [ // Technology Skills - 'react', 'angular', 'vue', 'javascript', 'typescript', 'python', 'java', - 'node', 'express', 'spring', 'django', 'mongodb', 'sql', 'postgresql', - 'aws', 'azure', 'docker', 'kubernetes', 'git', 'agile', 'scrum', - 'machine learning', 'ai', 'data science', 'devops', 'frontend', 'backend', + "react", + "angular", + "vue", + "javascript", + "typescript", + "python", + "java", + "node", + "express", + "spring", + "django", + "mongodb", + "sql", + "postgresql", + "aws", + "azure", + "docker", + "kubernetes", + "git", + "agile", + "scrum", + "machine learning", + "ai", + "data science", + "devops", + "frontend", + "backend", // Product & Analytics - 'product management', 'analytics', 'data analysis', 'market research', - 'user research', 'a/b testing', 'roadmap', 'wireframing', 'prototyping', + "product management", + "analytics", + "data analysis", + "market research", + "user research", + "a/b testing", + "roadmap", + "wireframing", + "prototyping", // Marketing & Sales - 'digital marketing', 'seo', 'sem', 'google ads', 'facebook ads', 'content marketing', - 'email marketing', 'social media', 'crm', 'salesforce', 'hubspot', 'lead generation', - 'account management', 'business development', 'sales strategy', + "digital marketing", + "seo", + "sem", + "google ads", + "facebook ads", + "content marketing", + "email marketing", + "social media", + "crm", + "salesforce", + "hubspot", + "lead generation", + "account management", + "business development", + "sales strategy", // Finance & Operations - 'financial modeling', 'excel', 'powerpoint', 'budgeting', 'forecasting', - 'financial analysis', 'sap', 'oracle', 'accounting', 'audit', 'compliance', - 'supply chain', 'logistics', 'operations', 'process improvement', 'lean six sigma', + "financial modeling", + "excel", + "powerpoint", + "budgeting", + "forecasting", + "financial analysis", + "sap", + "oracle", + "accounting", + "audit", + "compliance", + "supply chain", + "logistics", + "operations", + "process improvement", + "lean six sigma", // HR & Legal - 'talent acquisition', 'recruiting', 'hris', 'performance management', - 'employee relations', 'compensation', 'benefits', 'learning development', - 'contract law', 'corporate law', 'compliance', 'legal research', + "talent acquisition", + "recruiting", + "hris", + "performance management", + "employee relations", + "compensation", + "benefits", + "learning development", + "contract law", + "corporate law", + "compliance", + "legal research", // Design & Creative - 'figma', 'sketch', 'adobe creative suite', 'photoshop', 'illustrator', - 'ui design', 'ux design', 'visual design', 'graphic design', 'brand design', - 'prototyping', 'user experience', 'design systems', 'wireframing', + "figma", + "sketch", + "adobe creative suite", + "photoshop", + "illustrator", + "ui design", + "ux design", + "visual design", + "graphic design", + "brand design", + "prototyping", + "user experience", + "design systems", + "wireframing", // Consulting & Strategy - 'strategy development', 'business analysis', 'change management', - 'project management', 'stakeholder management', 'process consulting' + "strategy development", + "business analysis", + "change management", + "project management", + "stakeholder management", + "process consulting", ]; const detected = { - location: locationKeywords.some(keyword => lowerQuery.includes(keyword)), - jobTitle: jobTitleKeywords.some(keyword => lowerQuery.includes(keyword)), - experience: experiencePatterns.some(pattern => pattern.test(lowerQuery)), - industry: industryKeywords.some(keyword => lowerQuery.includes(keyword)), - skills: skillKeywords.some(keyword => lowerQuery.includes(keyword)), + location: locationKeywords.some((keyword) => lowerQuery.includes(keyword)), + jobTitle: jobTitleKeywords.some((keyword) => lowerQuery.includes(keyword)), + experience: experiencePatterns.some((pattern) => pattern.test(lowerQuery)), + industry: industryKeywords.some((keyword) => lowerQuery.includes(keyword)), + skills: skillKeywords.some((keyword) => lowerQuery.includes(keyword)), }; setDetectedCriteria(detected); @@ -215,15 +433,15 @@ export default function SearchPage() { setSearching(true); try { - const response = await fetch('/api/ai-search', { - method: 'POST', + const response = await fetch("/api/ai-search", { + method: "POST", headers: { - 'Content-Type': 'application/json', + "Content-Type": "application/json", }, body: JSON.stringify({ query: query, - candidates: candidates - }) + candidates: candidates, + }), }); if (response.ok) { @@ -234,7 +452,7 @@ export default function SearchPage() { setFilteredCandidates(applyFilters(candidates)); } } catch (error) { - console.error('AI search error:', error); + console.error("AI search error:", error); setFilteredCandidates(applyFilters(candidates)); } finally { setSearching(false); @@ -246,28 +464,26 @@ export default function SearchPage() { let filtered = candidateList; // Experience filter - filtered = filtered.filter(candidate => { + filtered = filtered.filter((candidate) => { const experience = parseInt(candidate.experience); return experience >= experienceRange[0] && experience <= experienceRange[1]; }); // Location filter if (selectedLocations.length > 0) { - filtered = filtered.filter(candidate => - selectedLocations.some(location => candidate.location.includes(location)) + filtered = filtered.filter((candidate) => + selectedLocations.some((location) => candidate.location.includes(location)) ); } // Gender filter if (selectedGenders.length > 0) { - filtered = filtered.filter(candidate => - selectedGenders.includes(candidate.gender) - ); + filtered = filtered.filter((candidate) => selectedGenders.includes(candidate.gender)); } // Ethnicity filter if (selectedEthnicities.length > 0) { - filtered = filtered.filter(candidate => + filtered = filtered.filter((candidate) => selectedEthnicities.includes(candidate.ethnicity) ); } @@ -293,7 +509,7 @@ export default function SearchPage() { if (checked) { setSelectedLocations([...selectedLocations, location]); } else { - setSelectedLocations(selectedLocations.filter(l => l !== location)); + setSelectedLocations(selectedLocations.filter((l) => l !== location)); } }; @@ -301,7 +517,7 @@ export default function SearchPage() { if (checked) { setSelectedGenders([...selectedGenders, gender]); } else { - setSelectedGenders(selectedGenders.filter(g => g !== gender)); + setSelectedGenders(selectedGenders.filter((g) => g !== gender)); } }; @@ -309,14 +525,14 @@ export default function SearchPage() { if (checked) { setSelectedEthnicities([...selectedEthnicities, ethnicity]); } else { - setSelectedEthnicities(selectedEthnicities.filter(e => e !== ethnicity)); + setSelectedEthnicities(selectedEthnicities.filter((e) => e !== ethnicity)); } }; // Get unique values for filters - const uniqueLocations = Array.from(new Set(candidates.map(c => c.location.split(',')[0]))); - const uniqueGenders = Array.from(new Set(candidates.map(c => c.gender))); - const uniqueEthnicities = Array.from(new Set(candidates.map(c => c.ethnicity))); + const uniqueLocations = Array.from(new Set(candidates.map((c) => c.location.split(",")[0]))); + const uniqueGenders = Array.from(new Set(candidates.map((c) => c.gender))); + const uniqueEthnicities = Array.from(new Set(candidates.map((c) => c.ethnicity))); const clearAllFilters = () => { setSelectedLocations([]); @@ -332,7 +548,9 @@ export default function SearchPage() {

Search Candidates

-

Finding the perfect talent for your team

+

+ Finding the perfect talent for your team +

@@ -367,18 +585,14 @@ export default function SearchPage() { value={searchQuery} onChange={(e) => setSearchQuery(e.target.value)} onKeyPress={(e) => { - if (e.key === 'Enter') { + if (e.key === "Enter") { handleSearch(); } }} className="pl-9 h-12 text-base" />
- @@ -117,10 +99,10 @@ export function LoginForm({
- By clicking continue, you agree to our{" "} - Terms of Service and{" "} + By clicking continue, you agree to our Terms of Service and{" "} Privacy Policy.
); } +