openreplay/frontend/app/components/Session_/EventsBlock/Metadata/Metadata.js
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

38 lines
1,013 B
JavaScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import React from 'react';
import { useStore } from 'App/mstore';
import { observer } from 'mobx-react-lite';
import MetadataItem from './MetadataItem';
import { useTranslation } from 'react-i18next';
function Metadata() {
const { sessionStore } = useStore();
const { metadata } = sessionStore.current;
const { t } = useTranslation();
const metaLength = Object.keys(metadata).length;
if (metaLength === 0) {
return (
<span className="text-sm color-gray-medium">
{t('Check')}&nbsp;
<a
href="https://docs.openreplay.com/en/session-replay/metadata"
target="_blank"
className="link"
>
{t('how to use Metadata')}
</a>{' '}
{t('if you havent yet done so.')}
</span>
);
}
return (
<div>
{Object.keys(metadata).map((key) => {
const value = metadata[key];
return <MetadataItem item={{ value, key }} key={key} />;
})}
</div>
);
}
export default observer(Metadata);