260322:1648 Correct Coresspondence / Doing RFA / Correct CI
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
"use client";
|
||||
'use client';
|
||||
|
||||
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
|
||||
import { Badge } from "@/components/ui/badge";
|
||||
import Link from "next/link";
|
||||
import { PendingTask } from "@/types/dashboard";
|
||||
import { AlertCircle, ArrowRight } from "lucide-react";
|
||||
import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card';
|
||||
import { Badge } from '@/components/ui/badge';
|
||||
import Link from 'next/link';
|
||||
import { PendingTask } from '@/types/dashboard';
|
||||
import { _AlertCircle, ArrowRight } from 'lucide-react';
|
||||
|
||||
interface PendingTasksProps {
|
||||
tasks: PendingTask[] | undefined;
|
||||
@@ -13,18 +13,20 @@ interface PendingTasksProps {
|
||||
|
||||
export function PendingTasks({ tasks, isLoading }: PendingTasksProps) {
|
||||
if (isLoading) {
|
||||
return (
|
||||
<Card className="h-full">
|
||||
<CardHeader><CardTitle className="text-lg">Pending Tasks</CardTitle></CardHeader>
|
||||
<CardContent>
|
||||
<div className="space-y-3">
|
||||
{[...Array(3)].map((_, i) => (
|
||||
<div key={i} className="h-14 bg-muted animate-pulse rounded-md" />
|
||||
))}
|
||||
</div>
|
||||
</CardContent>
|
||||
</Card>
|
||||
)
|
||||
return (
|
||||
<Card className="h-full">
|
||||
<CardHeader>
|
||||
<CardTitle className="text-lg">Pending Tasks</CardTitle>
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
<div className="space-y-3">
|
||||
{[...Array(3)].map((_, i) => (
|
||||
<div key={i} className="h-14 bg-muted animate-pulse rounded-md" />
|
||||
))}
|
||||
</div>
|
||||
</CardContent>
|
||||
</Card>
|
||||
);
|
||||
}
|
||||
|
||||
if (!tasks) tasks = [];
|
||||
@@ -35,7 +37,10 @@ export function PendingTasks({ tasks, isLoading }: PendingTasksProps) {
|
||||
<CardTitle className="text-lg flex items-center gap-2">
|
||||
Pending Tasks
|
||||
{tasks.length > 0 && (
|
||||
<Badge variant="destructive" className="rounded-full h-5 w-5 p-0 flex items-center justify-center text-[10px]">
|
||||
<Badge
|
||||
variant="destructive"
|
||||
className="rounded-full h-5 w-5 p-0 flex items-center justify-center text-[10px]"
|
||||
>
|
||||
{tasks.length}
|
||||
</Badge>
|
||||
)}
|
||||
@@ -44,9 +49,7 @@ export function PendingTasks({ tasks, isLoading }: PendingTasksProps) {
|
||||
<CardContent>
|
||||
<div className="space-y-3">
|
||||
{tasks.length === 0 ? (
|
||||
<p className="text-sm text-muted-foreground text-center py-4">
|
||||
No pending tasks. Good job!
|
||||
</p>
|
||||
<p className="text-sm text-muted-foreground text-center py-4">No pending tasks. Good job!</p>
|
||||
) : (
|
||||
tasks.map((task) => (
|
||||
<Link
|
||||
@@ -55,22 +58,21 @@ export function PendingTasks({ tasks, isLoading }: PendingTasksProps) {
|
||||
className="block p-3 bg-muted/40 rounded-lg border hover:bg-muted/60 transition-colors group"
|
||||
>
|
||||
<div className="flex items-start justify-between mb-1">
|
||||
<span className="text-sm font-medium group-hover:text-primary transition-colors">
|
||||
{task.title}
|
||||
</span>
|
||||
<span className="text-sm font-medium group-hover:text-primary transition-colors">{task.title}</span>
|
||||
{task.daysOverdue > 0 ? (
|
||||
<Badge variant="destructive" className="text-[10px] h-5 px-1.5">
|
||||
{task.daysOverdue}d overdue
|
||||
</Badge>
|
||||
) : (
|
||||
<Badge variant="outline" className="text-[10px] h-5 px-1.5 bg-yellow-50 text-yellow-700 border-yellow-200">
|
||||
<Badge
|
||||
variant="outline"
|
||||
className="text-[10px] h-5 px-1.5 bg-yellow-50 text-yellow-700 border-yellow-200"
|
||||
>
|
||||
Due Soon
|
||||
</Badge>
|
||||
)}
|
||||
</div>
|
||||
<p className="text-xs text-muted-foreground line-clamp-1 mb-2">
|
||||
{task.description}
|
||||
</p>
|
||||
<p className="text-xs text-muted-foreground line-clamp-1 mb-2">{task.description}</p>
|
||||
<div className="flex items-center text-xs text-primary font-medium">
|
||||
View Details <ArrowRight className="ml-1 h-3 w-3" />
|
||||
</div>
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
"use client";
|
||||
'use client';
|
||||
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { PlusCircle, Upload, FileText } from "lucide-react";
|
||||
import Link from "next/link";
|
||||
import { Button } from '@/components/ui/button';
|
||||
import { PlusCircle, Upload, FileText } from 'lucide-react';
|
||||
import Link from 'next/link';
|
||||
|
||||
export function QuickActions() {
|
||||
return (
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
"use client";
|
||||
'use client';
|
||||
|
||||
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
|
||||
import { Avatar, AvatarFallback } from "@/components/ui/avatar";
|
||||
import { Badge } from "@/components/ui/badge";
|
||||
import { formatDistanceToNow } from "date-fns";
|
||||
import { ActivityLog } from "@/types/dashboard";
|
||||
import Link from "next/link";
|
||||
import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card';
|
||||
import { Avatar, AvatarFallback } from '@/components/ui/avatar';
|
||||
import { Badge } from '@/components/ui/badge';
|
||||
import { formatDistanceToNow } from 'date-fns';
|
||||
import { ActivityLog } from '@/types/dashboard';
|
||||
import Link from 'next/link';
|
||||
|
||||
interface RecentActivityProps {
|
||||
activities: ActivityLog[] | undefined;
|
||||
@@ -14,29 +14,31 @@ interface RecentActivityProps {
|
||||
|
||||
export function RecentActivity({ activities, isLoading }: RecentActivityProps) {
|
||||
if (isLoading) {
|
||||
return (
|
||||
<Card className="h-full">
|
||||
<CardHeader><CardTitle className="text-lg">Recent Activity</CardTitle></CardHeader>
|
||||
<CardContent>
|
||||
<div className="space-y-6">
|
||||
{[...Array(3)].map((_, i) => (
|
||||
<div key={i} className="h-16 bg-muted animate-pulse rounded-md" />
|
||||
))}
|
||||
</div>
|
||||
</CardContent>
|
||||
</Card>
|
||||
)
|
||||
return (
|
||||
<Card className="h-full">
|
||||
<CardHeader>
|
||||
<CardTitle className="text-lg">Recent Activity</CardTitle>
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
<div className="space-y-6">
|
||||
{[...Array(3)].map((_, i) => (
|
||||
<div key={i} className="h-16 bg-muted animate-pulse rounded-md" />
|
||||
))}
|
||||
</div>
|
||||
</CardContent>
|
||||
</Card>
|
||||
);
|
||||
}
|
||||
|
||||
if (!activities || activities.length === 0) {
|
||||
return (
|
||||
<Card className="h-full">
|
||||
<CardHeader><CardTitle className="text-lg">Recent Activity</CardTitle></CardHeader>
|
||||
<CardContent className="text-muted-foreground text-sm text-center py-8">
|
||||
No recent activity.
|
||||
</CardContent>
|
||||
</Card>
|
||||
);
|
||||
return (
|
||||
<Card className="h-full">
|
||||
<CardHeader>
|
||||
<CardTitle className="text-lg">Recent Activity</CardTitle>
|
||||
</CardHeader>
|
||||
<CardContent className="text-muted-foreground text-sm text-center py-8">No recent activity.</CardContent>
|
||||
</Card>
|
||||
);
|
||||
}
|
||||
return (
|
||||
<Card className="h-full">
|
||||
@@ -46,10 +48,7 @@ export function RecentActivity({ activities, isLoading }: RecentActivityProps) {
|
||||
<CardContent>
|
||||
<div className="space-y-6">
|
||||
{activities.map((activity) => (
|
||||
<div
|
||||
key={activity.id}
|
||||
className="flex gap-4 pb-4 border-b last:border-0 last:pb-0"
|
||||
>
|
||||
<div key={activity.id} className="flex gap-4 pb-4 border-b last:border-0 last:pb-0">
|
||||
<Avatar className="h-10 w-10 border">
|
||||
<AvatarFallback className="bg-primary/10 text-primary font-medium">
|
||||
{activity.user.initials}
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
"use client";
|
||||
'use client';
|
||||
|
||||
import { Card } from "@/components/ui/card";
|
||||
import { FileText, Clipboard, CheckCircle, Clock } from "lucide-react";
|
||||
import { DashboardStats } from "@/types/dashboard";
|
||||
import { Card } from '@/components/ui/card';
|
||||
import { FileText, Clipboard, CheckCircle, Clock } from 'lucide-react';
|
||||
import { DashboardStats } from '@/types/dashboard';
|
||||
|
||||
export interface StatsCardsProps {
|
||||
stats: DashboardStats | undefined;
|
||||
@@ -21,32 +21,32 @@ export function StatsCards({ stats, isLoading }: StatsCardsProps) {
|
||||
}
|
||||
const cards = [
|
||||
{
|
||||
title: "Total Correspondences",
|
||||
title: 'Total Correspondences',
|
||||
value: stats.totalDocuments,
|
||||
icon: FileText,
|
||||
color: "text-blue-600",
|
||||
bgColor: "bg-blue-50",
|
||||
color: 'text-blue-600',
|
||||
bgColor: 'bg-blue-50',
|
||||
},
|
||||
{
|
||||
title: "Active RFAs",
|
||||
title: 'Active RFAs',
|
||||
value: stats.totalRfas,
|
||||
icon: Clipboard,
|
||||
color: "text-purple-600",
|
||||
bgColor: "bg-purple-50",
|
||||
color: 'text-purple-600',
|
||||
bgColor: 'bg-purple-50',
|
||||
},
|
||||
{
|
||||
title: "Approved Documents",
|
||||
title: 'Approved Documents',
|
||||
value: stats.approved,
|
||||
icon: CheckCircle,
|
||||
color: "text-green-600",
|
||||
bgColor: "bg-green-50",
|
||||
color: 'text-green-600',
|
||||
bgColor: 'bg-green-50',
|
||||
},
|
||||
{
|
||||
title: "Pending Approvals",
|
||||
title: 'Pending Approvals',
|
||||
value: stats.pendingApprovals,
|
||||
icon: Clock,
|
||||
color: "text-orange-600",
|
||||
bgColor: "bg-orange-50",
|
||||
color: 'text-orange-600',
|
||||
bgColor: 'bg-orange-50',
|
||||
},
|
||||
];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user