// Non-default VITE_JRE_SOURCE modes get a coloured badge so it's obvious which // version of json-edit-react the demo is consuming. The `npm` (default / // deployed) mode renders nothing — what real users see has no badge. const badges: Record = { local: { label: 'LOCAL', backgroundColor: '#ef4444' }, build: { label: 'BUILD', backgroundColor: '#ff51ff' }, pack: { label: 'PACK', backgroundColor: '#f59e0b' }, } const SourceIndicator = () => { const source = import.meta.env.VITE_JRE_SOURCE const badge = badges[source] if (!badge) return null return (
{badge.label}
) } export default SourceIndicator