All files / src/icons SDSIcon.tsx

100% Statements 8/8
100% Branches 1/1
100% Functions 1/1
100% Lines 8/8

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 261x 1x           1x                       1x 1x 7x 7x   1x  
/** @internal */
import CustomFileIcon, { type CustomFileIconProps } from '@/icons/CustomFileIcon';
import { FC } from 'react';
 
/** Props for {@link SDSIcon}: all {@link CustomFileIconProps} except the fixed `label`. */
export type SDSIconProps = Omit<CustomFileIconProps, 'label'>;
 
/**
 * A Material-UI icon component that renders a Safety Data Sheet (SDS) document.
 * Thin wrapper over {@link CustomFileIcon} with a yellow body and a red "SDS" label; all
 * colors and the optional `language` badge can still be overridden via props.
 *
 * @component
 * @param props - {@link CustomFileIconProps} overrides (colors, `language`, SvgIcon props)
 * @returns A React component that renders the SDS icon
 * @example
 * // Default yellow document, red "SDS" label, with an English badge
 * <SDSIcon fontSize="small" language="EN" />
 * @source
 */
const SDSIcon: FC<SDSIconProps> = (props) => {
  return <CustomFileIcon label="SDS" labelColor="#e8302a" {...props} />;
};
 
export default SDSIcon;