chore: remove legacy PDF417 generation implementation
Delete custom PDF417 generator and renderer now that all components use zxing-wasm/writer. Removes Pdf417Barcode component, generateBarcode, and renderBarcode utilities. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,29 +0,0 @@
|
||||
'use client';
|
||||
|
||||
import { useState, useEffect, FC } from 'react';
|
||||
import { generateBarcode } from '../lib/pdf/pdf417';
|
||||
import { renderBarcode } from '../lib/pdf/renderBarcode';
|
||||
|
||||
export const Pdf417Barcode:FC<{hub3aText:string, className?: string}> = ({hub3aText: hub3a_text, className}) => {
|
||||
const [bitmapData, setBitmapData] = useState<string | undefined>(undefined);
|
||||
|
||||
useEffect(() => {
|
||||
const barcodeMatrix = generateBarcode(hub3a_text);
|
||||
const bitmap = renderBarcode(barcodeMatrix, 2, 2);
|
||||
setBitmapData(bitmap);
|
||||
}, [hub3a_text]);
|
||||
|
||||
// Don't render until bitmap is generated (prevents hydration mismatch)
|
||||
if (!bitmapData) {
|
||||
return (
|
||||
<div style={{ width: "350px", height: "92px" }} className="flex items-center justify-center">
|
||||
<span className="loading loading-spinner loading-lg"></span>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
// eslint-disable-next-line @next/next/no-img-element
|
||||
<img src={bitmapData} alt="PDF417 Barcode" className={className} style={className ? undefined : { width: "350px", height: "92px" }} />
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user