diff --git a/frontend/vizzy/app/dashboard/proposals/[id]/proposal-details/page.tsx b/frontend/vizzy/app/dashboard/proposals/[id]/proposal-details/page.tsx index 8cba9572..8b1c1fa3 100644 --- a/frontend/vizzy/app/dashboard/proposals/[id]/proposal-details/page.tsx +++ b/frontend/vizzy/app/dashboard/proposals/[id]/proposal-details/page.tsx @@ -144,18 +144,20 @@ export default function ProposalDetailsPage() { <>

- Informações da Proposta + {t('proposalDetails.title')}

{proposal.description}

- Item para Troca + {t('proposalDetails.swapWith')}

{proposal.swap_with}

-

Proposta De

+

+ {t('proposalDetails.proposalFrom')} +

{senderProfile && ( )} @@ -165,7 +167,9 @@ export default function ProposalDetailsPage() { {proposalImages.length > 0 && (
-

Imagens em Anexo

+

+ {t('proposalDetails.proposalImages')} +

{proposalImages.map((imageUrl, index) => (
- Ver imagem + + {t('proposalDetails.viewImage')} +
))} @@ -198,18 +204,22 @@ export default function ProposalDetailsPage() { return (

- Informações da Proposta + {t('proposalDetails.title')}

{proposal.description}

-

Valor Proposto

+

+ {t('proposalDetails.offeredPrice')} +

€{proposal.offered_price?.toFixed(2) || '0.00'}

-

Proposta De

+

+ {t('proposalDetails.proposalFrom')} +

{senderProfile && }
@@ -220,18 +230,22 @@ export default function ProposalDetailsPage() { return (

- Informações da Proposta + {t('proposalDetails.title')}

{proposal.description}

-

Valor por Dia

+

+ {t('proposalDetails.valuePerDay')} +

€{proposal.offered_rent_per_day?.toFixed(2) || '0.00'}

-

Período

+

+ {t('proposalDetails.rentalPeriod')} +

{proposal.start_date && onlyDayMonthYear(proposal.start_date.toString())}{' '} @@ -245,12 +259,12 @@ export default function ProposalDetailsPage() { proposal.offered_rent_per_day && (

- Valor Total ( + {t('proposalDetails.totalValue')} ( {calculateTotalRentalDays( proposal.start_date.toString(), proposal.end_date.toString(), )}{' '} - dias) + {t('proposalDetails.days')})

€ @@ -264,7 +278,9 @@ export default function ProposalDetailsPage() {

)}
-

Proposta De

+

+ {t('proposalDetails.proposalFrom')} +

{senderProfile && }
@@ -275,11 +291,13 @@ export default function ProposalDetailsPage() { return (

- Informações da Proposta + {t('proposalDetails.title')}

{proposal.description}

-

Proposta De

+

+ {t('proposalDetails.proposalFrom')} +

{senderProfile && }
@@ -352,12 +370,16 @@ export default function ProposalDetailsPage() { {/* Listing Information */}
-

Informações do Anúncio

+

+ {t('proposalDetails.listingInfo.title')} +

{listing && ( )}
-

Anúncio De

+

+ {t('proposalDetails.listingInfo.listingFrom')} +

{receiverProfile && }
@@ -372,14 +394,14 @@ export default function ProposalDetailsPage() { className="flex-1 bg-brand-500" onClick={handleAcceptProposal} > - ✓ Aceitar Proposta + ✓ {t('proposalDetails.actionButtons.acceptProposal')} {listing && (listing.listing_type === 'sale' ? ( @@ -394,7 +416,10 @@ export default function ProposalDetailsPage() { onSubmit={handleCounterProposal} trigger={ } receiver_id={proposal.sender_id} @@ -408,12 +433,15 @@ export default function ProposalDetailsPage() { (listing as RentalListing).cost_per_day, ), image: listing.image_url, - condition: 'good', // Rental listings don't have condition + condition: '', }} onSubmit={handleCounterProposal} trigger={ } receiver_id={proposal.sender_id} @@ -425,12 +453,15 @@ export default function ProposalDetailsPage() { title: listing.title, price: 0, image: listing.image_url, - condition: 'good', + condition: '', }} onSubmit={handleCounterProposal} trigger={ } receiver_id={proposal.sender_id} @@ -442,12 +473,15 @@ export default function ProposalDetailsPage() { title: listing.title, price: 0, image: listing.image_url, - condition: 'good', + condition: '', }} onSubmit={handleCounterProposal} trigger={ } receiver_id={proposal.sender_id} @@ -497,6 +531,7 @@ function ProposalDetailsSkeleton() { } function ErrorState({ error }: { error: string | null }) { + const t = useTranslations('proposals.proposalDetails'); return (

@@ -507,7 +542,7 @@ function ErrorState({ error }: { error: string | null }) { className="mt-4" onClick={() => window.location.reload()} > - Try Again + {t('proposalDetails.tryAgain')}

); diff --git a/frontend/vizzy/components/proposals/cancel-proposal-dialog.tsx b/frontend/vizzy/components/proposals/cancel-proposal-dialog.tsx index e2413995..edad0175 100644 --- a/frontend/vizzy/components/proposals/cancel-proposal-dialog.tsx +++ b/frontend/vizzy/components/proposals/cancel-proposal-dialog.tsx @@ -15,6 +15,7 @@ import { Button } from '@/components/ui/common/button'; import { Trash2 } from 'lucide-react'; import { cancelProposal } from '@/lib/api/proposals/cancel-proposal'; import { toast } from 'sonner'; +import { useTranslations } from 'next-intl'; interface CancelProposalDialogProps { proposalId: number; @@ -25,6 +26,7 @@ export function CancelProposalDialog({ proposalId, onConfirm, }: CancelProposalDialogProps) { + const t = useTranslations('proposals'); console.log('Dialog opened with proposalId:', proposalId); const handleCancel = async () => { try { @@ -51,21 +53,24 @@ export function CancelProposalDialog({ - Cancelar Proposta + + {t('proposalDetails.cancelDialog.title')} + - Tem a certeza que pretende cancelar esta proposta? Esta ação não - pode ser revertida. + {t('proposalDetails.cancelDialog.description')} - Voltar + + {t('proposalDetails.cancelDialog.goBack')} + - Confirmar + {t('proposalDetails.cancelDialog.confirm')} diff --git a/frontend/vizzy/messages/en.json b/frontend/vizzy/messages/en.json index 466cfd27..8a381baf 100644 --- a/frontend/vizzy/messages/en.json +++ b/frontend/vizzy/messages/en.json @@ -306,6 +306,37 @@ "title": "Total Revenue", "description": "What you've earned so far!", "error": "Failed to load balance" + }, + "proposalDetails": { + "title": "Proposal Details", + "description": "Proposal description", + "swapWith": "Swap for", + "proposalFrom": "Proposal from", + "proposalTo": "Proposal to", + "proposalImages": "Attached Images", + "viewImage": "View Image", + "offeredPrice": "Offered Price", + "rentalPeriod": "Rental Period", + "valuePerDay": "Value per Day", + "totalValue": "Total Value", + "days": "days", + "listingInfo": { + "title": "Listing Information", + "listingFrom": "Listing from" + }, + "actionButtons": { + "acceptProposal": "Accept Proposal", + "rejectProposal": "Reject Proposal", + "makeCounterProposal": "Make Counter Proposal" + }, + "tryAgain": "Try Again", + "cancelDialog": { + "title": "Cancel Proposal", + "description": "Are you sure you want to cancel this proposal?", + "cancel": "Cancel", + "confirm": "Confirm", + "goBack": "Go Back" + } } } } diff --git a/frontend/vizzy/messages/pt.json b/frontend/vizzy/messages/pt.json index da5becc2..a78d84e8 100644 --- a/frontend/vizzy/messages/pt.json +++ b/frontend/vizzy/messages/pt.json @@ -306,6 +306,37 @@ "title": "Receita Total", "description": "O que já ganhaste até agora!", "error": "Erro ao carregar o saldo" + }, + "proposalDetails": { + "title": "Informações da Proposta", + "description": "Descrição da proposta", + "swapWith": "Para trocar por", + "proposalFrom": "Proposta de", + "proposalTo": "Para", + "proposalImages": "Imagens em Anexo", + "viewImage": "Ver Imagem", + "offeredPrice": "Valor Proposto", + "rentalPeriod": "Período de Aluguer", + "valuePerDay": "Valor por Dia", + "totalValue": "Valor Total", + "days": "dias", + "listingInfo": { + "title": "Informações do Anúncio", + "listingFrom": "Anúncio de" + }, + "actionButtons": { + "acceptProposal": "Aceitar Proposta", + "rejectProposal": "Rejeitar Proposta", + "makeCounterProposal": "Fazer Contra-Proposta" + }, + "tryAgain": "Tentar Novamente", + "cancelDialog": { + "title": "Cancelar Proposta", + "description": "Tem a certeza que deseja cancelar esta proposta?", + "cancel": "Cancelar", + "confirm": "Confirmar", + "goBack": "Voltar" + } } } }