create-broadcast-app
Version:
Create a NextGen TV broadcast app with one command
129 lines (121 loc) • 5.1 kB
text/typescript
/*
* Copyright © 2022 Sinclair Broadcast Group
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
import { AlertCode } from 'pages/alerts/types';
import { AlertState } from 'types/Alert';
enum AlertColors {
RED_COLOR = '#FA0000',
ORANGE_COLOR = '#F97301',
BLUE_COLOR = '#41BCD9',
GREEN_COLOR = '#2D834F',
}
enum AlertPriorityColors {
'#707070' = 0,
'#007efe' = 1,
'#f1ea00' = 2,
'#ff9900' = 3,
'#fd3434' = 4,
'#000000' = 10, // Reserved for rapid prototype
}
const ALERT_CODE_COLOR_MAP: Record<AlertCode, string> = {
[]: AlertColors.BLUE_COLOR,
[]: AlertColors.BLUE_COLOR,
[]: AlertColors.BLUE_COLOR,
[]: AlertColors.ORANGE_COLOR,
[]: AlertColors.RED_COLOR,
[]: AlertColors.RED_COLOR,
[]: AlertColors.RED_COLOR,
[]: AlertColors.RED_COLOR,
[]: AlertColors.ORANGE_COLOR,
[]: AlertColors.ORANGE_COLOR,
[]: AlertColors.ORANGE_COLOR,
[]: AlertColors.RED_COLOR,
[]: AlertColors.RED_COLOR,
[]: AlertColors.RED_COLOR,
[]: AlertColors.BLUE_COLOR,
[]: AlertColors.BLUE_COLOR,
[]: AlertColors.BLUE_COLOR,
[]: AlertColors.BLUE_COLOR,
[]: AlertColors.RED_COLOR,
[]: AlertColors.RED_COLOR,
[]: AlertColors.RED_COLOR,
[]: AlertColors.RED_COLOR,
[]: AlertColors.RED_COLOR,
[]: AlertColors.RED_COLOR,
[]: AlertColors.RED_COLOR,
[]: AlertColors.RED_COLOR,
[]: AlertColors.BLUE_COLOR,
[]: AlertColors.BLUE_COLOR,
[]: AlertColors.RED_COLOR,
[]: AlertColors.BLUE_COLOR,
[]: AlertColors.RED_COLOR,
[]: AlertColors.ORANGE_COLOR,
[]: AlertColors.RED_COLOR,
[]: AlertColors.ORANGE_COLOR,
[]: AlertColors.RED_COLOR,
[]: AlertColors.RED_COLOR,
[]: AlertColors.RED_COLOR,
[]: AlertColors.RED_COLOR,
[]: AlertColors.RED_COLOR,
[]: AlertColors.BLUE_COLOR,
[]: AlertColors.RED_COLOR,
[]: AlertColors.ORANGE_COLOR,
[]: AlertColors.RED_COLOR,
[]: AlertColors.ORANGE_COLOR,
[]: AlertColors.RED_COLOR,
[]: AlertColors.BLUE_COLOR,
[]: AlertColors.ORANGE_COLOR,
[]: AlertColors.RED_COLOR,
[]: AlertColors.RED_COLOR,
[]: AlertColors.ORANGE_COLOR,
[]: AlertColors.RED_COLOR,
[]: AlertColors.ORANGE_COLOR,
[]: AlertColors.RED_COLOR,
[]: AlertColors.RED_COLOR,
[]: AlertColors.ORANGE_COLOR,
[]: AlertColors.RED_COLOR,
[]: AlertColors.RED_COLOR,
[]: AlertColors.RED_COLOR,
[]: AlertColors.RED_COLOR,
[]: AlertColors.RED_COLOR,
[]: AlertColors.RED_COLOR,
[]: AlertColors.RED_COLOR,
[]: AlertColors.RED_COLOR,
[]: AlertColors.RED_COLOR,
[]: AlertColors.RED_COLOR,
[]: AlertColors.RED_COLOR,
[]: AlertColors.RED_COLOR,
[]: AlertColors.RED_COLOR,
[]: AlertColors.RED_COLOR,
[]: AlertColors.RED_COLOR,
[]: AlertColors.ORANGE_COLOR,
[]: AlertColors.ORANGE_COLOR,
[]: AlertColors.ORANGE_COLOR,
[]: AlertColors.ORANGE_COLOR,
[]: AlertColors.ORANGE_COLOR,
[]: AlertColors.BLUE_COLOR,
};
const ALERT_STATE_TEXT: Record<AlertState, string> = {
[]: 'alert',
[]: 'new',
[]: 'updated',
[]: 'cancelled',
};
export { ALERT_CODE_COLOR_MAP, ALERT_STATE_TEXT, AlertColors, AlertPriorityColors };