Files
5chan/src/components/version/version.tsx
T

32 lines
895 B
TypeScript
Raw Normal View History

import { useTranslation } from 'react-i18next';
import { currentAppVersion } from '../../lib/app-version';
2025-05-22 17:42:04 +02:00
const commitRef = import.meta.env.VITE_COMMIT_REF;
const isElectron = window.electronApi?.isElectron === true;
const Version = () => {
const { t } = useTranslation();
return (
<>
<a
href={commitRef ? `https://github.com/bitsocialnet/5chan/commit/${commitRef}` : `https://github.com/bitsocialnet/5chan/releases/tag/v${currentAppVersion}`}
target='_blank'
rel='noopener noreferrer'
>
v{commitRef ? `${currentAppVersion}#${commitRef.slice(0, 7)}` : currentAppVersion}
</a>
{isElectron && (
<>
{' '}
-{' '}
<a href='http://localhost:50019/webui/' target='_blank' rel='noreferrer'>
{t('node_stats')}
</a>
</>
)}
</>
);
};
export default Version;