import React, { useState } from 'react';
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from './ui/card';
import { Button } from './ui/button';
import { Input } from './ui/input';
import { Badge } from './ui/badge';
import { Avatar, AvatarFallback } from './ui/avatar';
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from './ui/select';
import { Tabs, TabsContent, TabsList, TabsTrigger } from './ui/tabs';
import {
FileText,
Search,
Filter,
Clock,
CheckCircle,
XCircle,
AlertCircle,
TrendingUp,
Calendar,
User,
ArrowRight,
MoreHorizontal,
Eye,
Edit,
Copy
} from 'lucide-react';
import { motion } from 'motion/react';
interface MyRequestsProps {
onViewRequest: (requestId: string, requestTitle?: string) => void;
dynamicRequests?: any[];
}
// Mock data for user's requests
const MY_REQUESTS_DATA = [
{
id: 'RE-REQ-2024-CM-001',
title: 'Dealer Marketing Activity Claim - Diwali Festival Campaign',
description: 'Claim request for dealer-led Diwali festival marketing campaign',
status: 'pending',
priority: 'standard',
department: 'Marketing - West Zone',
submittedDate: '2024-10-07',
currentApprover: 'Royal Motors Mumbai (Dealer)',
approverLevel: '1 of 8',
dueDate: '2024-10-16',
templateType: 'claim-management',
templateName: 'Claim Management',
estimatedCompletion: '2024-10-16'
},
{
id: 'RE-REQ-001',
title: 'Marketing Campaign Budget Approval',
description: 'Request for Q4 marketing campaign budget allocation for new motorcycle launch',
status: 'pending',
priority: 'express',
department: 'Marketing',
submittedDate: '2024-10-05',
currentApprover: 'Sarah Johnson',
approverLevel: '2 of 3',
dueDate: '2024-10-12'
},
{
id: 'RE-REQ-002',
title: 'IT Equipment Purchase Request',
description: 'New laptops and workstations for the development team',
status: 'approved',
priority: 'standard',
submittedDate: '2024-09-28',
currentApprover: 'Completed',
approverLevel: '3 of 3',
dueDate: '2024-10-01'
},
{
id: 'RE-REQ-003',
title: 'Training Program Authorization',
description: 'Employee skill development program for technical team',
status: 'in-review',
priority: 'standard',
submittedDate: '2024-10-03',
currentApprover: 'Michael Chen',
approverLevel: '1 of 2',
estimatedCompletion: '2024-10-10'
},
{
id: 'RE-REQ-004',
title: 'Vendor Contract Renewal',
description: 'Annual renewal for supply chain vendor contracts',
status: 'rejected',
priority: 'express',
submittedDate: '2024-09-25',
currentApprover: 'Rejected by Alex Kumar',
approverLevel: '1 of 3',
estimatedCompletion: 'N/A'
},
{
id: 'RE-REQ-005',
title: 'Office Space Renovation',
description: 'Workspace renovation for improved employee experience',
status: 'draft',
priority: 'standard',
submittedDate: '2024-10-07',
currentApprover: 'Not submitted',
approverLevel: '0 of 2',
estimatedCompletion: 'Pending submission'
}
];
const getStatusIcon = (status: string) => {
switch (status) {
case 'approved':
return
Track and manage all your submitted requests
Total
{stats.total}
In Progress
{stats.pending + stats.inReview}
Approved
{stats.approved}
Rejected
{stats.rejected}
Draft
{stats.draft}
{searchTerm || statusFilter !== 'all' || priorityFilter !== 'all' ? 'Try adjusting your search or filters' : 'You haven\'t created any requests yet'}
{request.description}