import { Form, QRCode, Slider, Switch } from "antd"; import { useSavedState } from "../../utils/saveload"; import PrintingDialog from "./printingDialog"; interface QRCodeData { value: string; label?: string; errorLevel?: "L" | "M" | "Q" | "H"; } interface QRCodePrintingDialogProps { visible: boolean; items: QRCodeData[]; } const QRCodePrintingDialog: React.FC = ({ visible, items, }) => { const [showContent, setShowContent] = useSavedState( "print-showContent", true ); const [textSize, setTextSize] = useSavedState("print-textSize", 5); const [showSpoolmanIcon, setShowSpoolmanIcon] = useSavedState( "print-showSpoolmanIcon", true ); const elements = items.map((item) => { return ( <> {showContent && (
{item.label ?? item.value}
)} ); }); return ( setShowContent(checked)} /> `${value} mm` }} min={3} max={15} value={textSize} step={0.1} onChange={(value) => { setTextSize(value); }} /> setShowSpoolmanIcon(checked)} /> } style={` .print-page .print-qrcode { height: 100% !important; width: 100% !important; } .print-page .print-qrcode-title { font-size: ${textSize}mm; } .print-page svg { display: block; height: 100%; width: auto; } `} onCancel={() => true} /> ); }; export default QRCodePrintingDialog;