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

34 lines
884 B
TypeScript
Raw Normal View History

import { useTranslation } from 'react-i18next';
import packageJson from '../../../package.json';
const { version } = packageJson;
2025-03-04 18:30:49 +01:00
const commitRef = process.env.VITE_COMMIT_REF;
const isElectron = window.isElectron === true;
const Version = () => {
const { t } = useTranslation();
return (
<>
<a
2025-03-04 18:43:52 +01:00
href={commitRef ? `https://github.com/plebbit/plebchan/commit/${commitRef}` : `https://github.com/plebbit/plebchan/releases/tag/v${version}`}
target='_blank'
rel='noopener noreferrer'
>
2025-03-04 15:30:12 +01:00
plebchan v{commitRef ? `${version}-dev (#${commitRef.slice(0, 7)})` : version}
</a>
{isElectron && (
<>
{' '}
-{' '}
<a href='http://localhost:50019/webui/' target='_blank' rel='noreferrer'>
{t('node_stats')}
</a>
</>
)}
</>
);
};
export default Version;