mirror of
https://github.com/fleetdm/fleet
synced 2026-05-23 00:49:03 +00:00
# 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>
25 lines
542 B
TypeScript
25 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;
|