Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions src/components/MeetingCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,15 @@ interface MeetingCardProps {
isOverTarget: boolean;
onAction: (action: string, meetingId: string) => void;
displayRank: number;
cost?: number;
}

export function MeetingCard({
meeting,
isOverTarget,
onAction,
displayRank,
cost,
}: MeetingCardProps) {
const [isExpanded, setIsExpanded] = useState(false);
const { meetingStatus = {} } = useSettingsStore();
Expand Down Expand Up @@ -67,6 +69,13 @@ export function MeetingCard({
});
};

const getCostIndicator = (cost: number): string => {
if (cost >= 50000) return "$$$$";
if (cost >= 20000) return "$$$";
if (cost >= 5000) return "$$";
return "";
};

const hasPreRead =
meeting.description &&
parseMeetingContent(meeting.description).preReadLinks.length > 0;
Expand Down Expand Up @@ -113,6 +122,19 @@ export function MeetingCard({
{meeting.participants.length}
</span>
</div>
{cost !== undefined && (
<div className="flex items-center ml-2">
<span className="text-sm text-gray-600">
$
{cost.toLocaleString(undefined, { maximumFractionDigits: 0 })}
</span>
{getCostIndicator(cost) && (
<span className="font-bold text-amber-500 ml-1">
{getCostIndicator(cost)}
</span>
)}
</div>
)}
{getStatusCount() > 0 && (
<span className="bg-red-100 text-red-600 text-xs px-1.5 py-0.5 rounded-full">
{getStatusCount()} action{getStatusCount() !== 1 ? "s" : ""}{" "}
Expand Down
7 changes: 7 additions & 0 deletions src/components/Plan.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,13 @@ export function Plan() {
isOverTarget={runningTotal > currentTargetHours}
onAction={handleMeetingAction}
displayRank={index + 1}
cost={
meeting.participants.filter(
(p) => !p.includes("resource.calendar.google.com")
).length *
meeting.duration *
200
}
/>
</div>
)}
Expand Down
3 changes: 2 additions & 1 deletion src/services/ampEmailService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ interface EmailRecipient {

// Helper function for formatting meeting duration
const formatDuration = (duration: number): string => {
return (duration / 60).toFixed(2) + " hours";
const minutes = Math.max(1, Math.round(duration * 60));
return `${minutes} minutes`;
};

export class AmpEmailService {
Expand Down
2 changes: 1 addition & 1 deletion src/services/emailService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const formatComments = (meetingId: string): string => {
};

const formatDuration = (hours: number): string => {
const minutes = Math.round(hours * 60);
const minutes = Math.max(1, Math.round(hours * 60));
return `${minutes}min`;
};

Expand Down