From 409813b2b7b55b2e79f63ebf3c6ff8f7dbb20076 Mon Sep 17 00:00:00 2001
From: DevKoya <138589181+DevKoya06@users.noreply.github.com>
Date: Fri, 20 Nov 2026 06:30:38 +0100
Subject: [PATCH] feat: [Feature]: Proposal Comparison & Shortlisting Interface
(#239)
---
app/dashboard/proposals/[projectId]/page.tsx | 13 ++-
components/proposals/index.ts | 5 +-
components/proposals/proposal-card.tsx | 26 ++++-
.../proposals/proposal-confirm-dialog.tsx | 45 +++++--
components/proposals/proposal-empty-state.tsx | 8 +-
components/proposals/proposal-list.tsx | 110 ++++++++++++++----
components/proposals/proposal-skeleton.tsx | 64 ++++++++--
.../proposals/proposal-status-badge.tsx | 9 +-
8 files changed, 228 insertions(+), 52 deletions(-)
diff --git a/app/dashboard/proposals/[projectId]/page.tsx b/app/dashboard/proposals/[projectId]/page.tsx
index de5c63e..67e1d8d 100644
--- a/app/dashboard/proposals/[projectId]/page.tsx
+++ b/app/dashboard/proposals/[projectId]/page.tsx
@@ -4,6 +4,7 @@ import { db as sql } from "@/lib/proposals/db";
import { verifyAccessToken } from "@/lib/auth/session";
import { ACCESS_TOKEN_COOKIE } from "@/lib/auth/constants";
import { ProposalList } from "@/components/proposals";
+import { ProposalComparison } from "@/components/proposals/proposal-comparison";
export default async function ProposalsPage({
params,
@@ -33,16 +34,20 @@ export default async function ProposalsPage({
if (!isClient && !isFreelancer) notFound();
return (
-
+
Proposals
{isClient
- ? "Review, filter, and manage freelancer proposals."
+ ? "Review, compare, shortlist, and manage freelancer proposals."
: "Your submitted proposals and their status."}
-
+ {isClient ? (
+
+ ) : (
+
+ )}
);
-}
\ No newline at end of file
+}
diff --git a/components/proposals/index.ts b/components/proposals/index.ts
index d56dd20..fe3b470 100644
--- a/components/proposals/index.ts
+++ b/components/proposals/index.ts
@@ -4,4 +4,7 @@ export * from "./proposal-filters";
export * from "./proposal-status-badge";
export * from "./proposal-confirm-dialog";
export * from "./proposal-skeleton";
-export * from "./proposal-empty-state";
\ No newline at end of file
+export * from "./proposal-empty-state";
+export * from "./proposal-comparison";
+export * from "./proposal-comparison-table";
+export * from "./proposal-shortlist-toggle";
diff --git a/components/proposals/proposal-card.tsx b/components/proposals/proposal-card.tsx
index 52d8120..ecf72ec 100644
--- a/components/proposals/proposal-card.tsx
+++ b/components/proposals/proposal-card.tsx
@@ -8,17 +8,21 @@ import type { Proposal } from "@/lib/proposals/types";
interface Props {
proposal: Proposal;
readOnly?: boolean;
+ isShortlisted?: boolean;
onAccept?: (p: Proposal) => void;
onReject?: (p: Proposal) => void;
onViewProfile?: (p: Proposal) => void;
+ onToggleShortlist?: (p: Proposal) => void;
}
export function ProposalCard({
proposal,
readOnly,
+ isShortlisted,
onAccept,
onReject,
onViewProfile,
+ onToggleShortlist,
}: Props) {
const ISO = /^[A-Z]{3}$/;
const code = (proposal.currency || "").toUpperCase();
@@ -33,6 +37,10 @@ export function ProposalCard({
.join("")
.toUpperCase();
+ const canDecide = !readOnly && proposal.status === "pending";
+ const canShortlist =
+ !readOnly && onToggleShortlist && (proposal.status === "pending" || proposal.status === "shortlisted");
+
return (
@@ -44,7 +52,7 @@ export function ProposalCard({
{proposal.freelancerName}
{proposal.freelancerRating.toFixed(1)} / 5
- ·
+ ·
{proposal.freelancerPastContracts} jobs
@@ -64,7 +72,7 @@ export function ProposalCard({
{proposal.coverLetter}
-
+
Budget:
{budget}
@@ -82,7 +90,17 @@ export function ProposalCard({
>
View profile
- {!readOnly && proposal.status === "pending" && (
+ {canShortlist && (
+
+ )}
+ {canDecide && (
<>