mirror of
https://github.com/BorysLevytskyi/BitwiseCmd.git
synced 2025-12-19 19:22:45 +01:00
Refactor towards modular structure
This commit is contained in:
33
src/shell/components/Indicators.tsx
Normal file
33
src/shell/components/Indicators.tsx
Normal file
@@ -0,0 +1,33 @@
|
||||
import AppState from "../AppState";
|
||||
import React from "react";
|
||||
|
||||
type IndicatorsProps = {
|
||||
appState: AppState
|
||||
};
|
||||
|
||||
function Indicators(props: IndicatorsProps) {
|
||||
|
||||
const list = [];
|
||||
const state = props.appState;
|
||||
|
||||
if(props.appState.env != 'prod') {
|
||||
list.push(state.env);
|
||||
}
|
||||
|
||||
if(props.appState.debugMode) {
|
||||
list.push("debug");
|
||||
}
|
||||
|
||||
if(localStorage.getItem('TrackAnalytics') === 'false') {
|
||||
list.push("notrack");
|
||||
}
|
||||
|
||||
if(list.length == 0)
|
||||
return null;
|
||||
|
||||
return <div>
|
||||
{list.map(i => <span>{i} </span>)}
|
||||
</div>
|
||||
}
|
||||
|
||||
export default Indicators;
|
||||
Reference in New Issue
Block a user