@@ -7,7 +7,7 @@ import DialogTitle from '@mui/material/DialogTitle';
77import Typography from '@mui/material/Typography' ;
88import React , { useState } from 'react' ;
99
10- import { useProposalInvites } from 'hooks/proposal /useProposalInvites' ;
10+ import { useProposalInvites } from 'hooks/invite /useProposalInvites' ;
1111
1212interface ProposalInviteNotificationProps {
1313 // We'll fetch the invites directly rather than passing count
@@ -20,7 +20,7 @@ const ProposalInviteNotification: React.FC<
2020 const [ processingInviteId , setProcessingInviteId ] = useState < number | null > (
2121 null
2222 ) ;
23- const { invites , loading, acceptInvite, declineInvite } =
23+ const { proposalInvites , loading, acceptInvite, declineInvite } =
2424 useProposalInvites ( ) ;
2525
2626 const handleViewInvites = ( ) => {
@@ -32,30 +32,30 @@ const ProposalInviteNotification: React.FC<
3232 } ;
3333
3434 const handleAcceptInvite = async ( inviteId : number ) => {
35- setProcessingInviteId ( inviteId ) ;
36- const success = await acceptInvite ( inviteId ) ;
37- setProcessingInviteId ( null ) ;
38- if ( success && invites . length === 1 ) {
39- // If this was the last invite, close the dialog
40- setIsDialogOpen ( false ) ;
41- }
35+ // setProcessingInviteId(inviteId);
36+ // const success = await acceptInvite(inviteId);
37+ // setProcessingInviteId(null);
38+ // if (success && userProposalInvites .length === 1) {
39+ // // If this was the last invite, close the dialog
40+ // setIsDialogOpen(false);
41+ // }
4242 } ;
4343
4444 const handleDeclineInvite = async ( inviteId : number ) => {
45- setProcessingInviteId ( inviteId ) ;
46- const success = await declineInvite ( inviteId ) ;
47- setProcessingInviteId ( null ) ;
48- if ( success && invites . length === 1 ) {
49- // If this was the last invite, close the dialog
50- setIsDialogOpen ( false ) ;
51- }
45+ // setProcessingInviteId(inviteId);
46+ // const success = await declineInvite(inviteId);
47+ // setProcessingInviteId(null);
48+ // if (success && userProposalInvites .length === 1) {
49+ // // If this was the last invite, close the dialog
50+ // setIsDialogOpen(false);
51+ // }
5252 } ;
5353
54- if ( invites . length === 0 ) {
54+ if ( proposalInvites . length === 0 ) {
5555 return null ;
5656 }
5757
58- const inviteCount = invites . length ;
58+ const inviteCount = proposalInvites . length ;
5959
6060 return (
6161 < >
@@ -97,12 +97,12 @@ const ProposalInviteNotification: React.FC<
9797 < Typography variant = "h6" > Proposal Invitations</ Typography >
9898 </ DialogTitle >
9999 < DialogContent >
100- { invites . length === 0 ? (
100+ { proposalInvites . length === 0 ? (
101101 < Typography variant = "body1" color = "textSecondary" >
102102 No pending invitations found.
103103 </ Typography >
104104 ) : (
105- invites . map ( ( invite ) => (
105+ proposalInvites . map ( ( invite ) => (
106106 < Alert
107107 key = { invite . id }
108108 severity = "info"
@@ -141,10 +141,10 @@ const ProposalInviteNotification: React.FC<
141141 >
142142 < div >
143143 < Typography variant = "subtitle2" fontWeight = "bold" >
144- { invite . proposalTitle }
144+ { invite . proposal ?. title || 'No Title' }
145145 </ Typography >
146146 < Typography variant = "body2" color = "textSecondary" >
147- Principal Investigator: { invite . principalInvestigatorName }
147+ Principal Investigator: asd
148148 </ Typography >
149149 < Typography variant = "caption" color = "textSecondary" >
150150 Invited on:{ ' ' }
0 commit comments