From d6a56e8be29c1e8ea77d970434b8c441f23acdef Mon Sep 17 00:00:00 2001
From: Miqdad <ahmadmiqdad27@gmail.com>
Date: Fri, 19 Sep 2025 17:16:54 +0700
Subject: <Miqdad> add role

---
 app/lib/camera/component/dispatchCamera.tsx | 43 +++++++++++++++++++++++++++++
 1 file changed, 43 insertions(+)
 create mode 100644 app/lib/camera/component/dispatchCamera.tsx

(limited to 'app/lib/camera/component/dispatchCamera.tsx')

diff --git a/app/lib/camera/component/dispatchCamera.tsx b/app/lib/camera/component/dispatchCamera.tsx
new file mode 100644
index 0000000..2591413
--- /dev/null
+++ b/app/lib/camera/component/dispatchCamera.tsx
@@ -0,0 +1,43 @@
+import React from "react";
+import useCameraStore from "../hooks/useCameraStore";
+import { IconButton } from "@mui/material";
+import { LocalShipping } from "@mui/icons-material";
+
+const DispatchCamera: React.FC = () => {
+  const { setImageDispatch } = useCameraStore();
+  const handleCapture = (event: React.ChangeEvent<HTMLInputElement>) => {
+    const file = event.target.files?.[0];
+    if (file) {
+      const reader = new FileReader();
+      reader.onloadend = () => {
+        setImageDispatch(reader.result as string);
+      };
+      reader.readAsDataURL(file);
+    }
+  };
+
+  return (
+    <div className="px-4 py-8 items-center border-2 rounded-md shadow-sm w-[49%] text-center ">
+      <input
+        type="file"
+        accept="image/*"
+        onChange={handleCapture}
+        className="hidden"
+        id="dispatchCameraInput"
+      />
+      <label htmlFor="dispatchCameraInput" className="text-gray-600">
+        <IconButton
+          color="primary"
+          aria-label="upload picture"
+          component="span"
+        >
+          <LocalShipping fontSize="large" />
+        </IconButton>
+        <br />
+        Foto Dispatch
+      </label>
+    </div>
+  );
+};
+
+export default DispatchCamera;
-- 
cgit v1.2.3

