Skip to content
Closed
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
321 changes: 314 additions & 7 deletions package-lock.json

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@
"@types/base-64": "^1.0.2",
"@types/jsonwebtoken": "^9.0.9",
"@types/nodemailer": "^6.4.17",
"@types/quill": "^2.0.14",
"aws-sdk": "^2.1692.0",
"axios": "^1.10.0",
"base-64": "^1.0.0",
Expand All @@ -67,6 +66,7 @@
"googleapis": "^152.0.0",
"jotai": "^2.12.5",
"jsonwebtoken": "^9.0.2",
"jspdf": "^3.0.1",
"jwt-decode": "^4.0.0",
"kunuharupa": "^1.2.0",
"lodash-es": "^4.17.21",
Expand All @@ -91,6 +91,7 @@
"react-hook-form": "^7.60.0",
"react-hot-toast": "^2.5.2",
"react-icons": "^5.5.0",
"react-quill": "^2.0.0",
"react-toastify": "^11.0.5",
"recharts": "^2.15.0",
"socket.io": "^4.8.1",
Expand Down Expand Up @@ -118,6 +119,7 @@
"@types/mongoose": "^5.11.96",
"@types/node": "^20.17.17",
"@types/node-fetch": "^2.6.12",
"@types/quill": "^2.0.14",
"@types/react": "^19",
"@types/react-dom": "^19",
"@types/stopword": "^2.0.3",
Expand Down
32 changes: 23 additions & 9 deletions src/components/meetingSystem/MeetingItem.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import React from 'react';
import { Calendar, Clock, Download, Video, XCircle } from 'lucide-react';
import Meeting from '@/types/meeting';
import { getMeetingStatus, downloadMeetingNotesFile, canCancelMeeting } from '@/services/meetingApiServices';
import { getMeetingStatus, canCancelMeeting, checkMeetingNotesExist, fetchMeetingNotes } from '@/services/meetingApiServices';
import { generateMeetingNotesPDF, MeetingNotePDFData } from '@/utils/pdfHandler';
import OptimizedAvatar from '@/components/ui/OptimizedAvatar';

interface UserProfile {
Expand Down Expand Up @@ -83,15 +84,28 @@ export default function MeetingItem({
// Download notes for a meeting
const handleDownloadNotes = async () => {
try {
const success = await downloadMeetingNotesFile(
meeting._id,
userId,
`Meeting with ${otherUserName}`,
meeting.meetingTime.toString()
);
const notesData = await fetchMeetingNotes(meeting._id, userId);

if (success) {
onAlert('success', 'Notes downloaded successfully as Markdown file!');
if (notesData) {
const pdfData: MeetingNotePDFData = {
title: notesData.title || `Meeting with ${otherUserName}`,
content: notesData.content,
meetingId: meeting._id,
createdAt: notesData.createdAt,
lastModified: notesData.lastModified,
wordCount: notesData.wordCount,
tags: notesData.tags,
isPrivate: notesData.isPrivate,
otherUserName: otherUserName,
meetingInfo: {
description: meeting.description,
meetingTime: meeting.meetingTime.toString(),
isDeleted: false
}
};

generateMeetingNotesPDF(pdfData);
onAlert('success', 'Notes downloaded successfully as PDF!');
} else {
onAlert('info', 'No notes found for this meeting');
}
Expand Down
Loading
Loading