mirror of
https://github.com/empayre/fleet.git
synced 2024-11-06 08:55:24 +00:00
8162d052bf
# 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>
26 lines
542 B
TypeScript
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;
|