openreplay/frontend/app/components/Session_/EventsBlock/Metadata/Metadata.js
Андрей Бабушкин 2b1a9f3378 add locales and lint the project
2025-03-05 16:09:18 +01:00

39 lines
1 KiB
JavaScript
Raw 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')}
<a
href="https://docs.openreplay.com/installation/metadata"
target="_blank"
className="link"
rel="noreferrer"
>
{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);