import React from 'react'; import { Badge } from './ui/badge'; interface VersionBadgeProps { className?: string; } export const VersionBadge: React.FC = ({ className = '' }) => { const version = typeof __APP_VERSION__ !== 'undefined' ? __APP_VERSION__ : 'dev'; const buildTime = typeof __BUILD_TIMESTAMP__ !== 'undefined' ? __BUILD_TIMESTAMP__ : ''; // Format ISO string to a more readable short date/time const formattedTime = buildTime ? new Date(buildTime).toLocaleString(undefined, { month: 'short', day: 'numeric', hour: '2-digit', minute: '2-digit' }) : ''; return (
v{version} {formattedTime && ( Built: {formattedTime} )}
); }; export const useAppVersion = () => ({ version: typeof __APP_VERSION__ !== 'undefined' ? __APP_VERSION__ : 'dev', buildTimestamp: typeof __BUILD_TIMESTAMP__ !== 'undefined' ? __BUILD_TIMESTAMP__ : '', });