feat(ui): show user timezone in session list

This commit is contained in:
nick-delirium 2023-10-16 11:33:02 +02:00
parent babaa34815
commit ebb625dd2b

View file

@ -36,7 +36,7 @@ interface Props {
userDisplayName: string;
userCountry: string;
userCity: string;
usetState: string;
userState: string;
startedAt: number;
duration: Duration;
eventsCount: number;
@ -53,6 +53,7 @@ interface Props {
active: boolean;
isCallActive?: boolean;
agentIds?: string[];
timezone: string;
};
onUserClick?: (userId: string, userAnonymousId: string) => void;
hasUserFilter?: boolean;
@ -107,6 +108,7 @@ function SessionItem(props: RouteComponentProps & Props) {
metadata,
issueTypes,
active,
timezone: userTimezone,
} = session;
const location = props.location;
@ -198,7 +200,24 @@ function SessionItem(props: RouteComponentProps & Props) {
<Tooltip
delay={0}
disabled={props.isDisabled}
title={`${formatTimeOrDate(startedAt, timezone, true)} ${timezone.label}`}
title={
<div className={'flex flex-col gap-1'}>
<span>
Local Time: {formatTimeOrDate(startedAt, timezone, true)} {timezone.label}
</span>
{userTimezone ? (
<span>
User's Time:{' '}
{formatTimeOrDate(
startedAt,
{ label: userTimezone.split('+').join(' +'), value: userTimezone.split(':')[0] },
true
)}{' '}
{userTimezone}
</span>
) : null}
</div>
}
className="w-fit !block"
>
<TextEllipsis
@ -222,7 +241,12 @@ function SessionItem(props: RouteComponentProps & Props) {
</div>
<div style={{ width: '30%' }} className="px-2 flex flex-col justify-between">
<div style={{ height: '21px' }}>
<CountryFlag userCity={userCity} userState={userState} country={userCountry} showLabel={true} />
<CountryFlag
userCity={userCity}
userState={userState}
country={userCountry}
showLabel={true}
/>
</div>
<div className="color-gray-medium flex items-center py-1">
<span className="capitalize" style={{ maxWidth: '70px' }}>