Skip to content

Commit

Permalink
Feat(crm): Display company name and title for Hot Contact
Browse files Browse the repository at this point in the history
  • Loading branch information
arimet committed Jul 29, 2024
1 parent f8d615a commit 31b17c7
Showing 1 changed file with 17 additions and 7 deletions.
24 changes: 17 additions & 7 deletions examples/crm/src/dashboard/HotContacts.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from 'react';
import { Card, Box } from '@mui/material';
import { Card, Box, Stack, Typography } from '@mui/material';
import ContactsIcon from '@mui/icons-material/Contacts';
import { useGetList, Link, SimpleList, useGetIdentity } from 'react-admin';
import { formatDistance } from 'date-fns';
Expand Down Expand Up @@ -43,15 +43,25 @@ export const HotContacts = () => {
data={contactData}
total={contactTotal}
isPending={contactsLoading}
resource="contacts"
primaryText={contact =>
`${contact.first_name} ${contact.last_name}`
}
resource="contacts"
secondaryText={(contact: Contact) =>
formatDistance(contact.last_seen, new Date(), {
addSuffix: true,
})
}
secondaryText={contact => (
<Stack>
<Typography variant="caption">
{contact.title} at {contact.company_name}
</Typography>
<Typography
variant="caption"
color="text.secondary"
>
{formatDistance(contact.last_seen, new Date(), {
addSuffix: true,
})}
</Typography>
</Stack>
)}
leftAvatar={contact => <Avatar record={contact} />}
dense
/>
Expand Down

0 comments on commit 31b17c7

Please sign in to comment.