186bb9ea19
- Pagamenti: totale ereditato dalla somma accepted_total delle offerte attive (con override) + selettore schema rate 1/2/3 step; nuova colonna payments.percent per rescalare gli importi preservando label/stato - Fasi & Task: recomputePhaseStatus auto-cascade (task -> fase) su updateTaskStatus/addTask, fix UI stale, etichette Da iniziare/In corso/Completata - Pagina pubblica: colori fasi (grigio/blu/#1A463C) + fasi collassabili - Transcript del cliente visibili in tab Documenti admin e dashboard pubblica - Timer: inserimento manuale (+30/+60, minuti liberi, data) + elimina entry - CLAUDE.md: procedura Deploy & DB Access; push su main automatico Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
56 lines
1.4 KiB
TypeScript
56 lines
1.4 KiB
TypeScript
"use client";
|
|
|
|
import { TimerCell } from "@/components/admin/TimerCell";
|
|
import { ProfitabilityCard } from "@/components/admin/ProfitabilityCard";
|
|
import { ManualTimeEntry } from "@/components/admin/ManualTimeEntry";
|
|
|
|
type TimeEntry = {
|
|
id: string;
|
|
started_at: Date;
|
|
ended_at: Date | null;
|
|
duration_seconds: number | null;
|
|
};
|
|
|
|
type TimerTabProps = {
|
|
projectId: string;
|
|
acceptedTotal: string;
|
|
activeTimerEntryId: string | null;
|
|
activeTimerStartedAt: Date | null;
|
|
totalTrackedSeconds: number;
|
|
targetHourlyRate: number;
|
|
recentEntries: TimeEntry[];
|
|
};
|
|
|
|
export function TimerTab({
|
|
projectId,
|
|
acceptedTotal,
|
|
activeTimerEntryId,
|
|
activeTimerStartedAt,
|
|
totalTrackedSeconds,
|
|
targetHourlyRate,
|
|
recentEntries,
|
|
}: TimerTabProps) {
|
|
return (
|
|
<div className="space-y-6 max-w-sm">
|
|
<div className="bg-white rounded-lg border border-[#e5e7eb] p-4">
|
|
<h3 className="font-medium text-[#1a1a1a] mb-4">Timer</h3>
|
|
<TimerCell
|
|
clientId={projectId}
|
|
projectId={projectId}
|
|
activeEntryId={activeTimerEntryId}
|
|
activeStartedAt={activeTimerStartedAt}
|
|
totalTrackedSeconds={totalTrackedSeconds}
|
|
/>
|
|
</div>
|
|
|
|
<ManualTimeEntry projectId={projectId} recentEntries={recentEntries} />
|
|
|
|
<ProfitabilityCard
|
|
acceptedTotal={acceptedTotal}
|
|
totalTrackedSeconds={totalTrackedSeconds}
|
|
targetHourlyRate={targetHourlyRate}
|
|
/>
|
|
</div>
|
|
);
|
|
}
|