diff --git a/src/assets/printers/index.js b/src/assets/printers/index.js new file mode 100644 index 0000000..b4675e6 --- /dev/null +++ b/src/assets/printers/index.js @@ -0,0 +1,12 @@ +import zd41x from './zd41x.png'; + +// Library of printer images, keyed by printer model (as reported by the agent). +const PRINTER_IMAGES = { + 'ZD410-200dpi': zd41x, +}; + +export function getPrinterImage(model) { + return (model && PRINTER_IMAGES[model]) || null; +} + +export default PRINTER_IMAGES; diff --git a/src/assets/printers/zd41x.png b/src/assets/printers/zd41x.png new file mode 100644 index 0000000..cf55e9c Binary files /dev/null and b/src/assets/printers/zd41x.png differ diff --git a/src/components/OnlinePrinterIcons.jsx b/src/components/OnlinePrinterIcons.jsx index 7441930..805aa8c 100644 --- a/src/components/OnlinePrinterIcons.jsx +++ b/src/components/OnlinePrinterIcons.jsx @@ -15,6 +15,7 @@ import SettingsIcon from '@mui/icons-material/Settings'; import { enqueueSnackbar } from 'notistack'; import companyAutomat from '../automats/companyAutomat'; import { notifyError } from '../utils/notify'; +import { getPrinterImage } from '../assets/printers'; export default class OnlinePrinterIcons extends PureComponent { constructor(props) { @@ -247,6 +248,14 @@ export default class OnlinePrinterIcons extends PureComponent { > {activePrinter && ( + {getPrinterImage(activePrinter.model) ? ( + + ) : null} {activePrinter.model || 'Drucker'}