Fakultas Ilmu Komputer UI

Commit 20fc1953 authored by FadhilP's avatar FadhilP
Browse files

[REFACTOR] Add error alert above submit button

parent 78a12694
......@@ -30,7 +30,6 @@ const FormStatus = ({ idTransaksi, defaultStatus, paymentMethod }) => {
};
return (
<div data-testid="form-status">
{errorSend && <ErrorDiv>Status transaksi tidak dapat disimpan</ErrorDiv>}
<form
onSubmit={handleSubmit(onSubmit)}
css={css`
......@@ -60,6 +59,15 @@ const FormStatus = ({ idTransaksi, defaultStatus, paymentMethod }) => {
<option value="006">Dibatalkan</option>
</InputSelectForm>
</RowInput>
<RowInput>
{error && (
<ErrorDiv>
<button className="btn btn-danger">
Error !, Data tidak dapat disimpan
</button>
</ErrorDiv>
)}
</RowInput>
<Button
data-testid="button-submit-status"
type="submit"
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment