import { useTheme } from '../../../hooks' // ================================= // ====== Exports ================== // ================================= export { useStatusColorAppearanceMap } export type { StatusAppearanceUnion } // ================================= // ====== Constants ================ // ================================= const STATUS_APPEARANCES = { error: 'error', info: 'info', neutral: 'neutral', success: 'success', warning: 'warning', } as const type StatusAppearanceUnion = (typeof STATUS_APPEARANCES)[keyof typeof STATUS_APPEARANCES] type StatusAppearanceColors = Record< StatusAppearanceUnion, { background: string text: string icon: string } > // ================================= // ====== Hooks ==================== // ================================= function useStatusColorAppearanceMap(): StatusAppearanceColors { const { colors: { statusErrorComposedBackground, statusErrorComposedText, statusErrorComposedIcon, statusInfoComposedBackground, statusInfoComposedText, statusInfoComposedIcon, statusNeutralComposedBackground, statusNeutralComposedText, statusNeutralComposedIcon, statusSuccessComposedBackground, statusSuccessComposedText, statusSuccessComposedIcon, statusWarningComposedBackground, statusWarningComposedText, statusWarningComposedIcon, }, } = useTheme() return { error: { background: statusErrorComposedBackground, text: statusErrorComposedText, icon: statusErrorComposedIcon, }, info: { background: statusInfoComposedBackground, text: statusInfoComposedText, icon: statusInfoComposedIcon, }, neutral: { background: statusNeutralComposedBackground, text: statusNeutralComposedText, icon: statusNeutralComposedIcon, }, success: { background: statusSuccessComposedBackground, text: statusSuccessComposedText, icon: statusSuccessComposedIcon, }, warning: { background: statusWarningComposedBackground, text: statusWarningComposedText, icon: statusWarningComposedIcon, }, } }