openreplay/frontend/app/components/shared/SessionsTabOverview/components/LatestSessionsMessage/LatestSessionsMessage.tsx
Andrey Babushkin fd5c0c9747
Add lokalisation (#3092)
* applied eslint

* add locales and lint the project

* removed error boundary

* updated locales

* fix min files

* fix locales
2025-03-06 17:43:15 +01:00

31 lines
904 B
TypeScript

import React from 'react';
import { numberWithCommas } from 'App/utils';
import { useStore } from 'App/mstore';
import { observer } from 'mobx-react-lite';
import { useTranslation } from 'react-i18next';
function LatestSessionsMessage() {
const { searchStore } = useStore();
const { t } = useTranslation();
const count = searchStore.latestSessionCount;
const onShowNewSessions = () => {
searchStore.updateLatestSessionCount(0);
void searchStore.updateCurrentPage(1, true);
};
return count > 0 ? (
<div
className="bg-amber-50 p-1 flex w-full border-b text-center justify-center link"
style={{ backgroundColor: 'rgb(255 251 235)' }}
onClick={onShowNewSessions}
>
{t('Show')} {numberWithCommas(count)} {t('New')}{' '}
{count > 1 ? t('Sessions') : t('Session')}
</div>
) : (
<></>
);
}
export default observer(LatestSessionsMessage);