This commit is contained in:
seb
2026-11-01 23:56:34 +01:00
parent 6071e59d30
commit 0181e08657

View File

@@ -1,12 +1,15 @@
import zd41x from './zd41x.png';
// Library of printer images, keyed by printer model (as reported by the agent).
const PRINTER_IMAGES = {
'ZD410-200dpi': zd41x,
};
// Library of printer images. Entries are matched in order against the
// printer model (as reported by the agent), case-insensitively.
const PRINTER_IMAGES = [
{ pattern: /^ZD41/i, image: zd41x }, // ZD410, ZD411, ZD410-200dpi, ...
];
export function getPrinterImage(model) {
return (model && PRINTER_IMAGES[model]) || null;
if (!model) return null;
const entry = PRINTER_IMAGES.find(({ pattern }) => pattern.test(String(model).trim()));
return entry?.image ?? null;
}
export default PRINTER_IMAGES;