fleet/frontend/components/Graphic/Graphic.tsx
Marko Lisica 8162d052bf
Icons improvements (making frontend consistent with Figma component library) (#14185)
# Checklist for submitter

If some of the following don't apply, delete the relevant line.

- [ ] Manual QA for all new/changed functionality

---------

Co-authored-by: Gabriel Hernandez <ghernandez345@gmail.com>
2023-10-31 16:06:38 +00:00

26 lines
542 B
TypeScript

import React from "react";
import classnames from "classnames";
import { GraphicNames, GRAPHIC_MAP } from "components/graphics";
interface IGraphicProps {
name: GraphicNames;
className?: string;
}
const baseClass = "graphic";
const Graphic = ({ name, className }: IGraphicProps) => {
const classNames = classnames(baseClass, className);
const GraphicComponent = GRAPHIC_MAP[name];
return (
<div className={classNames} data-testid={`${name}-graphic`}>
<GraphicComponent />
</div>
);
};
export default Graphic;