diff --git a/src/components/auth/forgot-password-modal.tsx b/src/components/auth/forgot-password-modal.tsx index f5c9aaf..5bcaf79 100644 --- a/src/components/auth/forgot-password-modal.tsx +++ b/src/components/auth/forgot-password-modal.tsx @@ -197,8 +197,19 @@ export function ForgotPasswordModal({ }, 800); }; - const handleResendCode = (): void => { - console.log('Resend code to:', email); + /** + * Handle resend OTP code + * @description Resends the OTP verification code to the user's email + * @throws {Error} When resend request fails + */ + const handleResendCode = async (): Promise => { + try { + // TODO: Implement resend OTP API call + // await resendOtpCode(email); + } catch (error) { + // Error handling will be implemented with proper logging service + throw error; + } }; const handleBackdropClick = (): void => handleClose(); diff --git a/src/components/dashboard/agent-card.tsx b/src/components/dashboard/agent-card.tsx index 30b7e82..69419ab 100644 --- a/src/components/dashboard/agent-card.tsx +++ b/src/components/dashboard/agent-card.tsx @@ -7,8 +7,11 @@ * AgentCard component props */ interface AgentCardProps { + /** Agent title/name */ title: string; + /** Array of tag labels */ tags: string[]; + /** Agent description text */ description: string; } @@ -16,9 +19,13 @@ interface AgentCardProps { * AgentCard component * @description Card showing agent details with tags * @param props - Component props - * @returns AgentCard element + * @returns {JSX.Element} AgentCard element */ -export function AgentCard({ title, tags, description }: AgentCardProps) { +export function AgentCard({ + title, + tags, + description, +}: AgentCardProps): JSX.Element { // Define your colors in order const tagColors = [ "bg-[#E5E8F4]", // 1st tag (index 0) diff --git a/src/components/dashboard/agents-section.tsx b/src/components/dashboard/agents-section.tsx index e59fa2d..19b07e9 100644 --- a/src/components/dashboard/agents-section.tsx +++ b/src/components/dashboard/agents-section.tsx @@ -26,9 +26,12 @@ interface AgentsSectionProps { * Agents section component * @description Displays agents with tabs and pagination * @param props - Component props - * @returns AgentsSection element + * @returns {JSX.Element} AgentsSection element */ -export function AgentsSection({ agents, itemsPerPage = 6 }: AgentsSectionProps) { +export function AgentsSection({ + agents, + itemsPerPage = 6, +}: AgentsSectionProps): JSX.Element { const [activeTab, setActiveTab] = useState<'all' | 'my'>('all'); const [currentPage, setCurrentPage] = useState(1); @@ -57,9 +60,10 @@ export function AgentsSection({ agents, itemsPerPage = 6 }: AgentsSectionProps) /** * Handle page change + * @description Updates the current page number * @param page - New page number (1-indexed) */ - const handlePageChange = (page: number) => { + const handlePageChange = (page: number): void => { setCurrentPage(page); }; diff --git a/src/components/dashboard/metric-card.tsx b/src/components/dashboard/metric-card.tsx index 3176e5a..f33ed41 100644 --- a/src/components/dashboard/metric-card.tsx +++ b/src/components/dashboard/metric-card.tsx @@ -1,17 +1,40 @@ +/** + * Metric card component props + */ interface MetricCardProps { + /** Card title text */ title: string; + /** Card subtitle text */ subtitle: string; + /** Display value */ value: string; + /** Gradient color scheme */ gradient: 'blue-teal' | 'pink-purple' | 'orange-yellow' | 'blue-purple'; + /** Optional image URL for card decoration */ imageUrl?: string; } +/** + * Gradient style type + */ type GradientStyle = { backgroundImage?: string; background?: string; }; -export function MetricCard({ title, subtitle, value, gradient, imageUrl }: MetricCardProps) { +/** + * MetricCard component + * @description Displays a metric card with gradient background and optional image + * @param props - Component props + * @returns MetricCard element + */ +export function MetricCard({ + title, + subtitle, + value, + gradient, + imageUrl, +}: MetricCardProps): JSX.Element { const gradientStyles: Record = { 'blue-teal': { backgroundImage: 'linear-gradient(16.03674192372833deg, rgba(0, 27, 47, 1) 10.549%, rgba(6, 38, 168, 1) 30.146%, rgba(3, 154, 152, 1) 77.418%)', diff --git a/src/components/dashboard/pagination.tsx b/src/components/dashboard/pagination.tsx index f2ef982..25181f0 100644 --- a/src/components/dashboard/pagination.tsx +++ b/src/components/dashboard/pagination.tsx @@ -1,9 +1,15 @@ import { ChevronLeft, ChevronRight } from 'lucide-react'; +/** + * Pagination component props + */ interface PaginationProps { + /** Current active page number (1-indexed) */ currentPage: number; + /** Total number of pages */ totalPages: number; + /** Callback when page changes */ onPageChange: (page: number) => void; } @@ -11,12 +17,17 @@ interface PaginationProps { * Pagination component * @description Displays pagination controls with page numbers and navigation arrows * @param props - Component props - * @returns Pagination element + * @returns {JSX.Element} Pagination element */ -export function Pagination({ currentPage, totalPages, onPageChange }: PaginationProps) { +export function Pagination({ + currentPage, + totalPages, + onPageChange, +}: PaginationProps): JSX.Element { /** * Generate page numbers to display - * @returns Array of page numbers and ellipsis markers + * @description Calculates which page numbers to show based on current page and total pages + * @returns {Array} Array of page numbers and ellipsis markers */ const getPageNumbers = (): (number | 'ellipsis')[] => { const pages: (number | 'ellipsis')[] = []; @@ -58,8 +69,9 @@ export function Pagination({ currentPage, totalPages, onPageChange }: Pagination /** * Handle previous page navigation + * @description Navigates to the previous page if available */ - const handlePrevious = () => { + const handlePrevious = (): void => { if (currentPage > 1) { onPageChange(currentPage - 1); } @@ -67,8 +79,9 @@ export function Pagination({ currentPage, totalPages, onPageChange }: Pagination /** * Handle next page navigation + * @description Navigates to the next page if available */ - const handleNext = () => { + const handleNext = (): void => { if (currentPage < totalPages) { onPageChange(currentPage + 1); } @@ -76,9 +89,10 @@ export function Pagination({ currentPage, totalPages, onPageChange }: Pagination /** * Handle page number click + * @description Navigates to the specified page if valid * @param page - Page number to navigate to */ - const handlePageClick = (page: number) => { + const handlePageClick = (page: number): void => { if (page !== currentPage && page >= 1 && page <= totalPages) { onPageChange(page); } diff --git a/src/components/dashboard/sidebar.tsx b/src/components/dashboard/sidebar.tsx index 342ee07..d9c93af 100644 --- a/src/components/dashboard/sidebar.tsx +++ b/src/components/dashboard/sidebar.tsx @@ -5,9 +5,9 @@ import { APP_PATHS } from '@/routes'; /** * Sidebar component * @description Left sidebar navigation with icon menu - * @returns Sidebar element + * @returns {JSX.Element} Sidebar element */ -export function Sidebar() { +export function Sidebar(): JSX.Element { return (