Skip to content

Commit

Permalink
UI fixes for notes page
Browse files Browse the repository at this point in the history
  • Loading branch information
vorasudh committed Oct 1, 2024
1 parent a749860 commit 33f48f3
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions frontend/src/container/MeetingNotes/MeetingNotes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import {
ListItemIcon
} from '@mui/material';
import { useUser } from '../../utils/userProvider';
import { fetchConversation } from '../../utils/fetchRequests';
import { fetchConversation, fetchMeetingDetails } from '../../utils/fetchRequests';

const noteStyles = {
nextNote: {
Expand Down Expand Up @@ -45,14 +45,19 @@ export default function MeetingNotes() {
const [checkedNotes, setCheckedNotes] = useState<number[]>([])
const [nextNoteId, setNextNoteId] = useState<number | undefined>(undefined)


// Fetch agenda items
const { data: _notes, isLoading, isError } = useQuery({
queryKey: ['agendaItems', meetingId, userId],
queryFn: () => fetchConversation({ meetingId: parseInt(meetingId ?? '0'), userId }),
enabled: !!userId && !!meetingId,
});

const { data: meetingDetails } = useQuery({
queryKey: ['meeting', meetingId],
queryFn: () => fetchMeetingDetails({ meetingId: parseInt(meetingId ?? '0') }),
enabled: !!meetingId,
});

const notes = useMemo(() => _notes?.meeting_agenda.map(
(item,index) => ({ id: index+1, title: item.agenda_item, done: item.completed }))
, [_notes]
Expand Down Expand Up @@ -106,12 +111,12 @@ export default function MeetingNotes() {
}

return (
<Box>
<Box sx={{ marginTop: {xs: '32px', sm: '8px'}, padding: '16px' }}>
<Typography
variant="h4"
gutterBottom
sx={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center' }}>
Agenda for {meetingId}
Agenda for {meetingDetails?.title}
<Switch
onChange={() => setHideDoneFlag(!hideDoneFlag)}
checked={!hideDoneFlag}
Expand Down

0 comments on commit 33f48f3

Please sign in to comment.