Files
DentalManagementMH07/apps/Frontend/src/components/insurance/credentials-modal.jsx
Gitead 1edf73fdc8 feat: add new frontend components, MH batch worker, and gitignore rules
- Add all new Frontend source files (pages, components, hooks, utils)
- Add selenium_MHBatchPaymentCheckWorker.py and MHSinglePaymentCheckWorker.py
- Add install-steps-5-13.sh setup script
- Update .gitignore to exclude runtime/sensitive data (backups, uploads,
  chat-history, keys, downloads, generated .d.ts files) while keeping folders
- Add .gitkeep to preserve empty runtime folders in git

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-26 00:23:43 -04:00

61 lines
2.7 KiB
JavaScript

import { useState } from "react";
import { Button } from "@/components/ui/button";
import { Input } from "@/components/ui/input";
import { Label } from "@/components/ui/label";
import { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle, DialogFooter, } from "@/components/ui/dialog";
import { Eye, EyeOff } from "lucide-react";
export function CredentialsModal({ isOpen, onClose, onSubmit, providerName, isLoading = false, }) {
const [username, setUsername] = useState("");
const [password, setPassword] = useState("");
const [showPassword, setShowPassword] = useState(false);
const handleSubmit = (e) => {
e.preventDefault();
if (username && password) {
onSubmit({ username, password });
}
};
const handleClose = () => {
setUsername("");
setPassword("");
setShowPassword(false);
onClose();
};
return (<Dialog open={isOpen} onOpenChange={handleClose}>
<DialogContent className="sm:max-w-md">
<DialogHeader>
<DialogTitle>Insurance Portal Login</DialogTitle>
<DialogDescription>
Enter your credentials for {providerName} insurance portal to check
patient eligibility automatically.
</DialogDescription>
</DialogHeader>
<form onSubmit={handleSubmit} className="space-y-4">
<div className="space-y-2">
<Label htmlFor="username">Username</Label>
<Input id="username" type="text" value={username} onChange={(e) => setUsername(e.target.value)} placeholder="Enter your username" required disabled={isLoading}/>
</div>
<div className="space-y-2">
<Label htmlFor="password">Password</Label>
<div className="relative">
<Input id="password" type={showPassword ? "text" : "password"} value={password} onChange={(e) => setPassword(e.target.value)} placeholder="Enter your password" required disabled={isLoading}/>
<Button type="button" variant="ghost" size="sm" className="absolute right-0 top-0 h-full px-3 py-2 hover:bg-transparent" onClick={() => setShowPassword(!showPassword)} disabled={isLoading}>
{showPassword ? (<EyeOff className="h-4 w-4"/>) : (<Eye className="h-4 w-4"/>)}
</Button>
</div>
</div>
<DialogFooter className="flex gap-2">
<Button type="button" variant="outline" onClick={handleClose} disabled={isLoading}>
Cancel
</Button>
<Button type="submit" disabled={!username || !password || isLoading}>
{isLoading ? "Checking..." : "Check Eligibility"}
</Button>
</DialogFooter>
</form>
</DialogContent>
</Dialog>);
}