Skip to content

Commit

Permalink
Merge pull request #7 from salino3/fix-styles-tooltip
Browse files Browse the repository at this point in the history
add getEmailPrefix
  • Loading branch information
salino3 authored Jun 22, 2024
2 parents 641bc26 + b7d281a commit dcd3a2a
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@ export const CustomTooltip: React.FC = () => {
},
];

const getEmailPrefix = (email: string) => {
const atIndex = email.indexOf("@");
if (atIndex === -1) return email;
return email.substring(0, atIndex + 1) + "...";
};

return (
<div className="rootCustomTooltip">
<div className="containerTitle">
Expand Down Expand Up @@ -63,7 +69,7 @@ export const CustomTooltip: React.FC = () => {
<span>{item?.city}</span>
</th>
<th scope="row">
{item?.email}
{getEmailPrefix(item.email)}
<span>{item?.email}</span>
</th>
</tr>
Expand Down

0 comments on commit dcd3a2a

Please sign in to comment.