-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
95 additions
and
95 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,97 +1,63 @@ | ||
import { DataListCell, DataListRow } from "../../components/DataList"; | ||
import { Meeting, Contact } from "../../types/meetings.types"; | ||
import { | ||
Avatar, | ||
Box, | ||
HStack, | ||
LinkOverlay, | ||
Text, | ||
LinkBox, | ||
} from "@chakra-ui/react"; | ||
import React from "react"; | ||
import { Link } from "react-router-dom"; | ||
import React from 'react'; | ||
|
||
import { Avatar, Box, Checkbox, HStack, Text } from '@chakra-ui/react'; | ||
import { Link } from 'react-router-dom'; | ||
|
||
import { DataListCell, DataListRow } from '../../components/DataList'; | ||
import { Contact, Meeting } from '../../types/meetings.types'; | ||
|
||
type MeetingsHeaderProps = { | ||
meeting: Meeting; | ||
contacts: Contact[] | undefined; | ||
selected: boolean; | ||
setSelected: (id: string) => void; | ||
}; | ||
|
||
export const MeetingsRow = ({ meeting, contacts }: MeetingsHeaderProps) => { | ||
export const MeetingsRow = ({ meeting, contacts, selected, setSelected }: MeetingsHeaderProps) => { | ||
const getContactName = (id: string) => { | ||
const contact = contacts?.find((contact) => contact.id === id); | ||
return contact?.properties?.firstname + " " + contact?.properties?.lastname; | ||
return contact?.properties?.firstname + ' ' + contact?.properties?.lastname; | ||
}; | ||
const getContactEmail = (id: string) => { | ||
const contact = contacts?.find((contact) => contact.id === id); | ||
return contact?.properties?.email; | ||
}; | ||
return ( | ||
<DataListRow as={LinkBox} key={meeting.id}> | ||
<DataListRow key={meeting.id}> | ||
<DataListCell colName="checkbox" colWidth="2rem"> | ||
<Checkbox isChecked={selected} onChange={() => setSelected(meeting.id)} /> | ||
</DataListCell> | ||
<DataListCell colName="name"> | ||
<LinkOverlay as={Link} to={meeting.id}> | ||
<Link to={meeting.id}> | ||
<Text noOfLines={1} maxW="full"> | ||
{meeting.properties.hs_meeting_title} | ||
</Text> | ||
</LinkOverlay> | ||
</Link> | ||
</DataListCell> | ||
<DataListCell | ||
colName="time" | ||
fontSize="sm" | ||
position="relative" | ||
pointerEvents="none" | ||
> | ||
<DataListCell colName="time" fontSize="sm" position="relative" pointerEvents="none"> | ||
<Text noOfLines={1} maxW="full"> | ||
{meeting.properties.hs_meeting_start_time} | ||
</Text> | ||
{!!meeting.createdAt && ( | ||
<Text | ||
noOfLines={1} | ||
maxW="full" | ||
pointerEvents="auto" | ||
color="gray.600" | ||
_dark={{ color: "gray.300" }} | ||
> | ||
{meeting.createdAt} | ||
</Text> | ||
)} | ||
</DataListCell> | ||
<DataListCell colName="account"> | ||
<HStack maxW="100%"> | ||
<Avatar size="sm" name={meeting.id} mx="1" /> | ||
<Box minW="0"> | ||
<Text noOfLines={1} maxW="full" fontWeight="bold"> | ||
{getContactName( | ||
meeting.associations?.contacts?.results[0]?.id || "" | ||
)} | ||
{getContactName(meeting.associations?.contacts?.results[0]?.id || '')} | ||
</Text> | ||
<Text | ||
noOfLines={1} | ||
maxW="full" | ||
fontSize="sm" | ||
color="gray.600" | ||
_dark={{ color: "gray.300" }} | ||
> | ||
{getContactEmail( | ||
meeting.associations?.contacts?.results[0]?.id || "" | ||
)} | ||
<Text noOfLines={1} maxW="full" fontSize="sm" color="gray.600" _dark={{ color: 'gray.300' }}> | ||
{getContactEmail(meeting.associations?.contacts?.results[0]?.id || '')} | ||
</Text> | ||
</Box> | ||
</HStack> | ||
</DataListCell> | ||
<DataListCell | ||
colName="nextSteps" | ||
fontSize="sm" | ||
position="relative" | ||
pointerEvents="none" | ||
> | ||
<DataListCell colName="nextSteps" fontSize="sm" position="relative" pointerEvents="none"> | ||
<Text noOfLines={1} maxW="full"> | ||
{meeting.properties.hs_internal_meeting_notes || | ||
meeting.properties.hs_meeting_outcome} | ||
{meeting.properties.hs_internal_meeting_notes || meeting.properties.hs_meeting_outcome} | ||
</Text> | ||
</DataListCell> | ||
<DataListCell colName="actions"> | ||
{/* <meetingActions meeting={meeting} /> */} | ||
</DataListCell> | ||
<DataListCell colName="actions">{/* <meetingActions meeting={meeting} /> */}</DataListCell> | ||
</DataListRow> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters