import { IconDefinition } from '@fortawesome/fontawesome-svg-core'; import { ReactElement } from 'react'; /** * Anything a component will accept for an `icon` prop: either a FontAwesome * `IconDefinition` (rendered through `FontAwesomeIcon`) or an arbitrary React * element (rendered as-is) — an ``, an inline ``, another icon * library's component, … * * Deliberately `ReactElement` rather than `ReactNode`: `ReactNode` also covers * strings, numbers and booleans, so a required icon prop would stop catching * `icon="star"` at compile time and silently render the text instead. Matches * what `Input` has always accepted for its own icon prop. * * Render one with `renderIcon` from `components/common/utils/renderIcon`, which * picks the right branch. */ export type IconContent = IconDefinition | ReactElement;