import React from 'react';
import {
  Dialog,
  DialogContent,
  DialogHeader,
  DialogTitle,
  DialogDescription,
} from '@/components/ui/dialog';
import { Landmark } from 'lucide-react';

export default function BankAccountFormDialog({ open, onOpenChange, account, clientId, onSuccess, children }) {
  const handleSuccess = () => {
    if (onSuccess) onSuccess();
    onOpenChange(false);
  };

  return (
    <Dialog open={open} onOpenChange={onOpenChange}>
      <DialogContent className="sm:max-w-[600px] overflow-y-auto max-h-[90vh]">
        <DialogHeader>
          <DialogTitle className="flex items-center gap-2 text-xl">
            <Landmark className="w-5 h-5 text-primary" />
            {account ? 'Edit Bank Account' : 'Add New Bank Account'}
          </DialogTitle>
          <DialogDescription>
            {account ? 'Update the details for this bank account.' : "Enter the details for this association's new bank account."}
          </DialogDescription>
        </DialogHeader>

        <div className="pt-2">
          {children}
        </div>
      </DialogContent>
    </Dialog>
  );
}
