import { DefaultColorType } from './default-color-type';
import { SuperType, SuperTypes } from '../files';

export type DefaultBasedColorType = SuperType | 'updated' | 'suggestion' | 'analysis';

export const annotationDefaultColorConfig: Record<DefaultBasedColorType, DefaultColorType> = {
    [SuperTypes.TextHighlight]: 'redactionColor', // not actually used

    [SuperTypes.SuggestionChangeLegalBasis]: 'requestAddColor',
    [SuperTypes.SuggestionRecategorizeImage]: 'requestAddColor',
    [SuperTypes.SuggestionAddDictionary]: 'dictionaryRequestColor',
    [SuperTypes.SuggestionForceRedaction]: 'requestAddColor',
    [SuperTypes.SuggestionForceHint]: 'requestAddColor',
    [SuperTypes.SuggestionResize]: 'dictionaryRequestColor',
    [SuperTypes.SuggestionRemoveDictionary]: 'dictionaryRequestColor',
    [SuperTypes.SuggestionAdd]: 'requestAddColor',
    [SuperTypes.SuggestionRemove]: 'requestRemoveColor',
    [SuperTypes.DeclinedSuggestion]: 'skippedColor',

    [SuperTypes.IgnoredHint]: 'ignoredHintColor',
    [SuperTypes.Skipped]: 'skippedColor',
    [SuperTypes.Redaction]: 'redactionColor',
    [SuperTypes.ManualRedaction]: 'redactionColor',
    [SuperTypes.Recommendation]: 'recommendationColor',
    [SuperTypes.Hint]: 'hintColor',

    updated: 'updatedColor',
    suggestion: 'requestAddColor',
    analysis: 'analysisColor',
} as const;

type EntityBasedColorType =
    | typeof SuperTypes.IgnoredHint
    | typeof SuperTypes.Skipped
    | typeof SuperTypes.Redaction
    | typeof SuperTypes.ManualRedaction
    | typeof SuperTypes.Recommendation
    | typeof SuperTypes.Hint;

export const annotationEntityColorConfig: Record<EntityBasedColorType, 'hexColor' | 'recommendationHexColor' | 'skippedHexColor'> = {
    [SuperTypes.IgnoredHint]: 'skippedHexColor',
    [SuperTypes.Skipped]: 'skippedHexColor',
    [SuperTypes.Redaction]: 'hexColor',
    [SuperTypes.ManualRedaction]: 'hexColor',
    [SuperTypes.Recommendation]: 'recommendationHexColor',
    [SuperTypes.Hint]: 'hexColor',
} as const;
