mirror of
https://github.com/Radarr/Radarr.git
synced 2026-04-18 21:35:51 -04:00
(cherry picked from commit 811eb36c7b1a5124270ff93d18d16944e654de81) Co-authored-by: Mark McDowall <mark@mcdowall.ca> Closes #10764 Closes #10776 Closes #10781
95 lines
2.7 KiB
TypeScript
95 lines
2.7 KiB
TypeScript
import React from 'react';
|
|
import { useSelector } from 'react-redux';
|
|
import AppState from 'App/State/AppState';
|
|
import { icons, kinds } from 'Helpers/Props';
|
|
import createUISettingsSelector from 'Store/Selectors/createUISettingsSelector';
|
|
import translate from 'Utilities/String/translate';
|
|
import LegendIconItem from './LegendIconItem';
|
|
import LegendItem from './LegendItem';
|
|
import styles from './Legend.css';
|
|
|
|
function Legend() {
|
|
const view = useSelector((state: AppState) => state.calendar.view);
|
|
const { showCutoffUnmetIcon, fullColorEvents } = useSelector(
|
|
(state: AppState) => state.calendar.options
|
|
);
|
|
const { enableColorImpairedMode } = useSelector(createUISettingsSelector());
|
|
|
|
const iconsToShow = [];
|
|
const isAgendaView = view === 'agenda';
|
|
|
|
if (showCutoffUnmetIcon) {
|
|
iconsToShow.push(
|
|
<LegendIconItem
|
|
name={translate('CutoffNotMet')}
|
|
icon={icons.MOVIE_FILE}
|
|
kind={kinds.WARNING}
|
|
fullColorEvents={fullColorEvents}
|
|
tooltip={translate('QualityCutoffNotMet')}
|
|
/>
|
|
);
|
|
}
|
|
|
|
return (
|
|
<div className={styles.legend}>
|
|
<div>
|
|
<LegendItem
|
|
status="downloaded"
|
|
name={translate('DownloadedAndMonitored')}
|
|
isAgendaView={isAgendaView}
|
|
fullColorEvents={fullColorEvents}
|
|
colorImpairedMode={enableColorImpairedMode}
|
|
/>
|
|
|
|
<LegendItem
|
|
status="unmonitored"
|
|
name={translate('DownloadedButNotMonitored')}
|
|
isAgendaView={isAgendaView}
|
|
fullColorEvents={fullColorEvents}
|
|
colorImpairedMode={enableColorImpairedMode}
|
|
/>
|
|
</div>
|
|
|
|
<div>
|
|
<LegendItem
|
|
status="missingMonitored"
|
|
name={translate('MissingMonitoredAndConsideredAvailable')}
|
|
isAgendaView={isAgendaView}
|
|
fullColorEvents={fullColorEvents}
|
|
colorImpairedMode={enableColorImpairedMode}
|
|
/>
|
|
|
|
<LegendItem
|
|
status="missingUnmonitored"
|
|
name={translate('MissingNotMonitored')}
|
|
isAgendaView={isAgendaView}
|
|
fullColorEvents={fullColorEvents}
|
|
colorImpairedMode={enableColorImpairedMode}
|
|
/>
|
|
</div>
|
|
|
|
<div>
|
|
<LegendItem
|
|
status="queue"
|
|
name={translate('Queued')}
|
|
isAgendaView={isAgendaView}
|
|
fullColorEvents={fullColorEvents}
|
|
colorImpairedMode={enableColorImpairedMode}
|
|
/>
|
|
|
|
<LegendItem
|
|
status="continuing"
|
|
name={translate('Unreleased')}
|
|
isAgendaView={isAgendaView}
|
|
fullColorEvents={fullColorEvents}
|
|
colorImpairedMode={enableColorImpairedMode}
|
|
/>
|
|
</div>
|
|
|
|
{iconsToShow.length > 0 ? <div>{iconsToShow[0]}</div> : null}
|
|
</div>
|
|
);
|
|
}
|
|
|
|
export default Legend;
|