This commit is contained in:
zadit biasa aja
2025-07-02 10:33:06 +00:00
parent cb576b3176
commit 765d90ceec
2 changed files with 28 additions and 9 deletions

View File

@@ -283,7 +283,7 @@ body {
}
.submitButton:hover {
background-color: var(--dark-blue);
background-color: #d03b3b;
transform: translateY(-1px);
box-shadow: var(--shadow-md);
}
@@ -316,9 +316,9 @@ body {
}
.warning {
background-color: rgb(245 158 11 / 0.1);
color: var(--warning-amber);
border: 1px solid rgb(245 158 11 / 0.2);
background-color: #ef444417;
color: #ef4444;
border: 1px solid #ef444433;
padding: 1rem;
border-radius: 0.5rem;
margin-top: 1rem;

View File

@@ -266,6 +266,11 @@ const CameraCanvas = () => {
setLoading(false);
const data = await res.json();
if (data.responseCode == 409) {
console.log(409);
setFileTemp({ error: 409 });
return;
}
console.log(data);
setFileTemp(data);
@@ -530,7 +535,7 @@ const CameraCanvas = () => {
<div
style={{
padding: 10,
backgroundColor: "#ff6d6d",
backgroundColor: "#ef4444",
borderRadius: 15,
color: "white",
fontWeight: "bold",
@@ -543,7 +548,7 @@ const CameraCanvas = () => {
<div
style={{
padding: 10,
backgroundColor: "#ff6d6d",
backgroundColor: "#ef4444",
borderRadius: 15,
color: "white",
fontWeight: "bold",
@@ -567,13 +572,13 @@ const CameraCanvas = () => {
</div>
) : (
capturedImage &&
!fileTemp && (
(!fileTemp || fileTemp.error == undefined) && (
<div>
<h4 style={{ marginTop: 0 }}>Tinjau Gambar</h4>
<div
style={{
padding: 10,
backgroundColor: "#ff6d6d",
backgroundColor: "#ef4444",
borderRadius: 15,
color: "white",
fontWeight: "bold",
@@ -594,11 +599,25 @@ const CameraCanvas = () => {
</div>
)
)}
{fileTemp && (
{fileTemp && fileTemp.error != "409" ? (
<PaginatedFormEditable
data={fileTemp}
handleSimpan={(data) => handleSaveTemp(data)}
/>
) : (
fileTemp && (
<>
<h4>KTP Sudah Terdaftar</h4>
<h4
onClick={() => {
setFileTemp(null);
setIsFreeze(false);
}}
>
Hapus
</h4>
</>
)
)}
</div>