"use client" import { useState, useCallback, useRef, useEffect } from "react" import { AIChat } from "@/components/ai/ai-chat" import { JobSelector } from "@/components/ai/job-selector" import { Bot, ChevronRight } from "lucide-react" const tips = [ "Ask for cold email templates for a specific job", "Request objection handling tips", "Ask for outreach strategies per industry", "Generate a follow up sequence", "Get LinkedIn connection message templates", ] export default function AIAssistantPage() { const [selectedJob, setSelectedJob] = useState<{ job_title: string; keywords: string[]; industry: string; description: string } | null>(null) const [recentPrompts, setRecentPrompts] = useState([]) const aiChatRef = useRef<{ fillInput: (text: string) => void } | null>(null) const handleJobSelect = useCallback((job: typeof selectedJob) => { setSelectedJob(job) }, []) const handleTipClick = useCallback((tip: string) => { aiChatRef.current?.fillInput(tip) }, []) const handleRecentPromptClick = useCallback((prompt: string) => { aiChatRef.current?.fillInput(prompt) }, []) const handleMessageSent = useCallback((msg: string) => { setRecentPrompts((prev) => { const next = [msg, ...prev.filter((p) => p !== msg)].slice(0, 3) return next }) }, []) return (

AI Sales Assistant

Powered by local AI

Online
Local AI Model
Target Job
{selectedJob && (

{selectedJob.job_title}

{selectedJob.industry}

{selectedJob.description}

{selectedJob.keywords.map((kw, i) => ( {kw} ))}
)}
Quick Tips
{tips.map((tip, i) => (
handleTipClick(tip)} className="flex items-start gap-2.5 bg-[#1a1d2e]/50 hover:bg-[#1a1d2e] border border-[#ffffff08] hover:border-[#f97316]/20 rounded-xl p-3.5 mb-2 cursor-pointer transition-all duration-200 group" > {tip}
))}
Recent Prompts
{recentPrompts.length > 0 ? ( recentPrompts.map((prompt, i) => (
handleRecentPromptClick(prompt)} className="bg-[#1a1d2e]/50 rounded-xl p-3 mb-2 border border-[#ffffff08] text-[#6b7280] text-xs truncate hover:text-[#9ca3af] cursor-pointer transition-colors duration-200" > {prompt}
)) ) : (
Your recent prompts will appear here
)}
Messages today
24
Tokens used
12.4k
) }