// Copyright (c) 2025-2026, RTE (https://www.rte-france.com) // This Source Code Form is subject to the terms of the Mozilla Public License, version 2.0. // If a copy of the Mozilla Public License, version 2.0 was not distributed with this file, // you can obtain one at http://mozilla.org/MPL/2.0/. // SPDX-License-Identifier: MPL-2.0 // This file is part of Co-Study4Grid a Power Grid Study tool Assistant Interface to help solve contigencies for a grid state under study. import React from 'react'; export type SeverityKind = 'solves' | 'lowMargin' | 'unsolved' | 'divergent' | 'islanded'; /** * Monochrome severity pictogram. It draws with `currentColor`, so the * same glyph works as a coloured chip (the ActionCard severity badge) * and as a tinted filter toggle (the ActionFilterRings severity ring) * — the caller owns the colour, the icon owns the shape. */ export const SeverityIcon: React.FC<{ kind: SeverityKind; size?: number }> = ({ kind, size = 13 }) => { const common = { width: size, height: size, viewBox: '0 0 16 16', 'aria-hidden': true } as const; if (kind === 'solves') { return ( ); } if (kind === 'lowMargin') { // A circle with an exclamation — deliberately NOT a warning // triangle, so it doesn't read as the ⚠️ used for overloads. // Shares the circle frame with the solves / unsolved glyphs. return ( ); } // unsolved / divergent / islanded → X-circle return ( ); }; export default SeverityIcon;