feat: attrs on product

This commit is contained in:
2024-05-11 00:25:45 +03:00
parent 270f96bf8d
commit 8c04b9a5c7

View File

@@ -14,7 +14,7 @@ type Ref = HTMLDivElement;
const PrintBarcodeContainer = forwardRef<Ref, Props>(function PrintBarcodeContainer(props: Props, ref) {
const {attributes, barcode, quantity, additionalField} = props;
const MAX_ATTRIBUTES = additionalField ? 5 : 6;
const MAX_ATTRIBUTES = additionalField && additionalField.length > 0 ? 5 : 6;
const MIN_BARCODE_SIZE = 30;
const MAX_BARCODE_SIZE = 100;
const STEP = (MAX_BARCODE_SIZE - MIN_BARCODE_SIZE) / MAX_ATTRIBUTES;