import React, { useState } from "react";
import { Card, CardHeader, CardTitle, CardContent } from "@/components/ui/card";
import { Button } from "@/components/ui/button";
import { Input } from "@/components/ui/input";
import { Label } from "@/components/ui/label";
import { Checkbox } from "@/components/ui/checkbox";
import { FileText, Download, Upload, Save, X } from "lucide-react";
import { Badge } from "@/components/ui/badge";
export default function W9FormViewer({ vendor, onClose }) {
const [formData, setFormData] = useState({
entity_name: vendor?.business_name || "",
business_name: "",
tax_classification: "",
llc_classification: "",
has_foreign_partners: false,
exempt_payee_code: "",
fatca_code: "",
address: "",
city_state_zip: "",
account_numbers: "",
ssn_part1: "",
ssn_part2: "",
ssn_part3: "",
ein_part1: "",
ein_part2: "",
tin_type: "ssn",
signature: "",
date: ""
});
const handleChange = (field, value) => {
setFormData(prev => ({ ...prev, [field]: value }));
};
const handleSave = () => {
// Save logic here
console.log("Saving W9 form:", formData);
onClose?.();
};
return (
{/* Header with actions */}
Form W-9 (Rev. March 2024)
Request for Taxpayer Identification Number and Certification
Upload Signed
Download PDF
{/* Before you begin notice */}
Before you begin
Give form to the requester. Do not send to the IRS.
{/* Line 1 & 2 - Names */}
{/* Line 3a - Tax Classification */}
3a. Federal tax classification (Check only ONE box)
checked && handleChange('tax_classification', 'individual')}
/>
Individual/sole proprietor
checked && handleChange('tax_classification', 'c_corp')}
/>
C corporation
checked && handleChange('tax_classification', 's_corp')}
/>
S corporation
checked && handleChange('tax_classification', 'partnership')}
/>
Partnership
checked && handleChange('tax_classification', 'trust')}
/>
Trust/estate
checked && handleChange('tax_classification', 'llc')}
/>
LLC
Enter tax classification:
handleChange('llc_classification', e.target.value)}
placeholder="C, S, or P"
className="w-20 h-8"
maxLength={1}
/>
checked && handleChange('tax_classification', 'other')}
/>
Other (see instructions)
{/* Line 3b */}
handleChange('has_foreign_partners', checked)}
/>
3b. Foreign partners, owners, or beneficiaries
Check if you have any foreign partners, owners, or beneficiaries
{/* Line 4 - Exemptions */}
{/* Lines 5-7 - Address */}
{/* Part I - TIN */}
Part I - Taxpayer Identification Number (TIN)
Enter your TIN in the appropriate box. The TIN provided must match the name given on line 1 to avoid backup withholding.
{/* SSN */}
OR
{/* EIN */}
{/* Part II - Certification */}
Part II - Certification
Under penalties of perjury, I certify that:
The number shown on this form is my correct taxpayer identification number (or I am waiting for a number to be issued to me); and
I am not subject to backup withholding because (a) I am exempt from backup withholding, or (b) I have not been notified by the IRS that I am subject to backup withholding as a result of a failure to report all interest or dividends, or (c) the IRS has notified me that I am no longer subject to backup withholding; and
I am a U.S. citizen or other U.S. person (defined below); and
The FATCA code(s) entered on this form (if any) indicating that I am exempt from FATCA reporting is correct.
{/* Actions */}
Form W-9 (Rev. 3-2024)
Cancel
Save W-9 Form
);
}