feat(sitekey - select added)

This commit is contained in:
2026-01-28 02:49:46 +05:30
parent add03289c6
commit 9975fe9252

View File

@@ -2,6 +2,13 @@ import { useEffect, useState } from "react";
import { useMutation, useQueryClient } from "@tanstack/react-query"; import { useMutation, useQueryClient } from "@tanstack/react-query";
import { apiRequest } from "@/lib/queryClient"; import { apiRequest } from "@/lib/queryClient";
import { toast } from "@/hooks/use-toast"; import { toast } from "@/hooks/use-toast";
import {
Select,
SelectContent,
SelectItem,
SelectTrigger,
SelectValue,
} from "@/components/ui/select";
type CredentialFormProps = { type CredentialFormProps = {
onClose: () => void; onClose: () => void;
@@ -14,7 +21,16 @@ type CredentialFormProps = {
}; };
}; };
export function CredentialForm({ onClose, userId, defaultValues }: CredentialFormProps) { const SITE_KEYS = [
{ label: "MassHealth (MH)", value: "MH" },
{ label: "Delta Dental MA", value: "DDMA" },
];
export function CredentialForm({
onClose,
userId,
defaultValues,
}: CredentialFormProps) {
const [siteKey, setSiteKey] = useState(defaultValues?.siteKey || ""); const [siteKey, setSiteKey] = useState(defaultValues?.siteKey || "");
const [username, setUsername] = useState(defaultValues?.username || ""); const [username, setUsername] = useState(defaultValues?.username || "");
const [password, setPassword] = useState(defaultValues?.password || ""); const [password, setPassword] = useState(defaultValues?.password || "");
@@ -92,13 +108,19 @@ export function CredentialForm({ onClose, userId, defaultValues }: CredentialFor
<form onSubmit={handleSubmit} className="space-y-4"> <form onSubmit={handleSubmit} className="space-y-4">
<div> <div>
<label className="block text-sm font-medium">Site Key</label> <label className="block text-sm font-medium">Site Key</label>
<input <Select value={siteKey} onValueChange={setSiteKey}>
type="text" <SelectTrigger className="mt-1">
value={siteKey} <SelectValue placeholder="Select Site" />
onChange={(e) => setSiteKey(e.target.value)} </SelectTrigger>
className="mt-1 p-2 border rounded w-full"
placeholder="e.g., MH, Delta MA, (keep the site key exact same)" <SelectContent>
/> {SITE_KEYS.map((site) => (
<SelectItem key={site.value} value={site.value}>
{site.label}
</SelectItem>
))}
</SelectContent>
</Select>
</div> </div>
<div> <div>
<label className="block text-sm font-medium">Username</label> <label className="block text-sm font-medium">Username</label>