sample.tsx 494 B

123456789101112131415161718192021222324
  1. import * as Icons from 'sentry/icons';
  2. import {Aliases, Color, IconSize} from 'sentry/utils/theme';
  3. type Props = {
  4. color: Color | Aliases;
  5. name: string;
  6. size: IconSize;
  7. direction?: 'left' | 'right' | 'up' | 'down';
  8. isCircled?: boolean;
  9. isSolid?: boolean;
  10. type?: 'line' | 'circle' | 'bar';
  11. };
  12. const IconSample = ({name, ...props}: Props) => {
  13. const Icon = Icons[`Icon${name}`];
  14. if (!Icon) {
  15. return null;
  16. }
  17. return <Icon {...props} />;
  18. };
  19. export default IconSample;