mirror of
https://github.com/i701/sarlink-portal.git
synced 2025-08-03 21:17:44 +00:00
feat(admin-topup): add description field to topup form and validation for amount
All checks were successful
Build and Push Docker Images / Build and Push Docker Images (push) Successful in 8m56s
All checks were successful
Build and Push Docker Images / Build and Push Docker Images (push) Successful in 8m56s
fix(verify-registration-otp): improve styling and structure of OTP verification form
This commit is contained in:
@ -17,12 +17,14 @@ import {
|
||||
} from "@/components/ui/dialog";
|
||||
import { Input } from "@/components/ui/input";
|
||||
import { Label } from "@/components/ui/label";
|
||||
import { Textarea } from "../ui/textarea";
|
||||
|
||||
export type AddTopupFormState = {
|
||||
status: boolean;
|
||||
message: string;
|
||||
fieldErrors?: {
|
||||
amount?: string[];
|
||||
description?: string[];
|
||||
};
|
||||
payload?: FormData;
|
||||
};
|
||||
@ -81,9 +83,9 @@ export default function AddTopupDialogForm({ user_id }: { user_id?: string }) {
|
||||
</DialogHeader>
|
||||
<form action={formAction}>
|
||||
<div className="grid gap-4 py-4">
|
||||
<div className="flex flex-col gap-2">
|
||||
<div className="flex flex-col gap-3">
|
||||
<div className="flex flex-col gap-3">
|
||||
<Label htmlFor="device_name">Topup Amount</Label>
|
||||
<Label htmlFor="amount">Topup Amount</Label>
|
||||
<input type="hidden" name="user_id" value={user_id} />
|
||||
<Input
|
||||
type="number"
|
||||
@ -98,6 +100,23 @@ export default function AddTopupDialogForm({ user_id }: { user_id?: string }) {
|
||||
</span>
|
||||
)}
|
||||
</div>
|
||||
<div className="flex flex-col gap-3">
|
||||
<Label htmlFor="description">Topup Description</Label>
|
||||
<input type="hidden" name="user_id" value={user_id} />
|
||||
<Textarea
|
||||
defaultValue={(state?.payload?.get("description") || "") as string}
|
||||
rows={10}
|
||||
name="description"
|
||||
id="topup_description"
|
||||
className="col-span-5 max-w-[375px] h-32 resize-none"
|
||||
style={{ overflowY: "auto" }}
|
||||
/>
|
||||
{state.fieldErrors?.description && (
|
||||
<span className="text-red-500 text-sm">
|
||||
{state.fieldErrors.description[0]}
|
||||
</span>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<DialogFooter>
|
||||
|
Reference in New Issue
Block a user