diff --git a/src/components/RightPanel/LogoSection.tsx b/src/components/RightPanel/LogoSection.tsx new file mode 100644 index 0000000..48ab7e1 --- /dev/null +++ b/src/components/RightPanel/LogoSection.tsx @@ -0,0 +1,62 @@ +import { useRef } from 'react'; +import { useQR } from '../../context/QRContext'; + +export function LogoSection() { + const { state, dispatch } = useQR(); + const fileRef = useRef(null); + + const handleFile = (e: React.ChangeEvent) => { + const file = e.target.files?.[0]; + if (!file) return; + const reader = new FileReader(); + reader.onload = ev => dispatch({ type: 'SET_LOGO', payload: ev.target?.result as string }); + reader.readAsDataURL(file); + }; + + return ( +
+

Logo

+ + + {state.logoDataUrl ? ( +
+
+ logo +
+
+ + +
+
+ ) : ( + + )} + {state.logoDataUrl && ( +

+ Error correction raised to High (H) automatically. +

+ )} +
+ ); +}