import { useState } from "react"; // ── SURVEY DATA ────────────────────────────────────────────────────────────── const NP_SECTIONS = [ { id:"s1", title:"Legal & Organizational Standing", critical:true, questions:[ "Our organization has current 501(c)(3) status or a confirmed fiscal sponsor.", "Our organization is current on federal and state compliance filings.", "We have governing documents such as by-laws and board policies.", "We can clearly describe our mission, programs, and community served.", "We can provide our IRS determination letter and recent Form 990." ]}, { id:"s2", title:"Leadership & Governance", questions:[ "Our board meets regularly and is actively engaged.", "Board and staff roles are clearly defined.", "Leadership is stable enough to manage a grant-funded project.", "We have a strategic direction or plan that guides our work.", "Leadership can clearly explain our funding priorities." ]}, { id:"s3", title:"Financial Readiness", critical:true, questions:[ "We have a current operating budget.", "We have current financial statements.", "We can track restricted funds separately from general funds.", "We have clear financial approval and documentation procedures.", "We can provide financial review, audit, or equivalent records if requested." ]}, { id:"s4", title:"Program & Project Readiness", critical:true, questions:[ "We can clearly define the problem we seek to address.", "We have a specific project or program for which funding is sought.", "The project has goals, activities, and a realistic timeline.", "We have staff, consultants, or partners who can implement the work.", "We understand the total cost of the project." ]}, { id:"s5", title:"Data & Outcomes", questions:[ "We collect service or program data consistently.", "We can demonstrate outcomes, results, or community impact.", "We use data to support our statement of need.", "We can describe how we will measure success.", "We can provide stories, testimonials, or case examples that support our impact." ]}, { id:"s6", title:"Grant Strategy & Support Materials", critical:true, questions:[ "We understand which funders are a realistic fit for our organization.", "We have standard documents ready for proposals.", "We can provide staff and board bios.", "We can prepare or review a grant budget.", "We are prepared to manage reporting and compliance if funded." ]} ]; const FP_SECTIONS = [ { id:"s1", title:"Business Standing & Eligibility", critical:true, questions:[ "Our business is properly registered and in good standing.", "We have the licenses or permits needed for our operations.", "We can document ownership and authorized signatories.", "We understand whether the grants we seek permit for-profit applicants.", "We have or can obtain registrations required for target opportunities (UEI, SAM.gov, etc.)." ]}, { id:"s2", title:"Leadership & Management", questions:[ "We have leadership assigned to oversee funding strategy and project delivery.", "Leadership roles are clear and operationally functional.", "We have the management capacity to oversee a funded project.", "We can make decisions quickly enough to meet grant deadlines.", "We can clearly explain our business model and growth strategy." ]}, { id:"s3", title:"Financial Readiness", critical:true, questions:[ "We maintain current P&L, balance sheet, and cash flow records.", "We can separate project costs from routine operating costs.", "We have bookkeeping or accounting support.", "We understand whether a grant may require matching funds or reimbursement.", "We can provide credible financial documents to support an application." ]}, { id:"s4", title:"Project & Market Readiness", critical:true, questions:[ "We have a clearly defined product, service, or innovation.", "We can define the target market or beneficiary group.", "We can clearly state the problem or opportunity our project addresses.", "We can explain why grant funding is appropriate for this project.", "We have a realistic plan for implementation, scaling, or commercialization." ]}, { id:"s5", title:"Data & Results Capacity", questions:[ "We track key business or project performance metrics.", "We can define measurable project outcomes.", "We can support our need statement with market, operational, or community data.", "We can report progress during the grant period.", "We can document results such as jobs, revenue growth, innovation, or community benefit." ]}, { id:"s6", title:"Funding Fit & Documentation", critical:true, questions:[ "We are targeting grant opportunities that fit our stage and industry.", "We have a current business plan, capability statement, or growth narrative.", "We can provide key leader bios and project budgets.", "We have external partners, customers, or supporters who strengthen our credibility.", "We are prepared to manage compliance, records, and reporting if funded." ]} ]; // ── SCORING HELPERS ────────────────────────────────────────────────────────── function calcScores(answers, sections) { return sections.map(sec => { const vals = sec.questions.map((_, qi) => answers[`${sec.id}q${qi}`] ?? 0); const avg = vals.reduce((a, b) => a + b, 0) / vals.length; return { ...sec, avg, score10: parseFloat(((avg / 3) * 10).toFixed(1)) }; }); } function overallScore(ss) { return parseFloat((ss.reduce((a, s) => a + s.score10, 0) / ss.length).toFixed(1)); } function readinessCat(score) { if (score >= 9.0) return { label:"Grant Ready Now", color:"#1d6b3a", bg:"#e3f5eb", bar:"#2d8a4e" }; if (score >= 7.5) return { label:"Nearly Grant Ready", color:"#2d6b1a", bg:"#edf6e3", bar:"#4a9e2a" }; if (score >= 6.0) return { label:"Emerging Readiness", color:"#8a5c00", bg:"#fef7e0", bar:"#c9952a" }; if (score >= 4.0) return { label:"Limited Readiness", color:"#8a3a00", bg:"#fef0e0", bar:"#d4600a" }; return { label:"Not Grant Ready Yet", color:"#8a1a1a", bg:"#fde8e8", bar:"#b83232" }; } function tl(score10) { if (score10 >= 7.0) return { color:"#2d7a4f", label:"Strong" }; if (score10 >= 5.0) return { color:"#c9952a", label:"Needs Work" }; return { color:"#b83232", label:"Critical Gap" }; } // ── MAIN APP ───────────────────────────────────────────────────────────────── export default function App() { const [step, setStep] = useState(0); const [orgType, setOrgType] = useState(null); const [intake, setIntake] = useState({ orgName:"", contact:"", budget:"", purpose:"" }); const [answers, setAnswers] = useState({}); const [scores, setScores] = useState(null); const [aiReport, setAiReport] = useState(""); const [aiLoading, setAiLoading] = useState(false); const sections = orgType === "nonprofit" ? NP_SECTIONS : FP_SECTIONS; function setAnswer(secId, qi, val) { setAnswers(prev => ({ ...prev, [`${secId}q${qi}`]: val })); } function sectionComplete(sec) { return sec.questions.every((_, qi) => answers[`${sec.id}q${qi}`] !== undefined); } async function finish() { const ss = calcScores(answers, sections); const overall = overallScore(ss); setScores({ sections: ss, overall }); setStep(9); setAiLoading(true); const cat = readinessCat(overall); const scoreList = ss.map(s => `${s.title}: ${s.score10}/10`).join("; "); const sorted = [...ss].sort((a, b) => b.score10 - a.score10); const strong = sorted.slice(0,2).map(s=>s.title).join(" and "); const weak = sorted.slice(-2).reverse().map(s=>s.title).join(" and "); try { const res = await fetch("https://api.anthropic.com/v1/messages", { method:"POST", headers:{"Content-Type":"application/json"}, body: JSON.stringify({ model:"claude-sonnet-4-20250514", max_tokens:1000, messages:[{ role:"user", content: `You are a senior grants consultant at D B Pyoas & Associates LLC. Write a professional 3-paragraph executive summary for a grant readiness assessment report. Do NOT use bullet points or headers within your response — write in flowing prose only. Organization: ${intake.orgName || "the applicant organization"} Type: ${orgType === "nonprofit" ? "Nonprofit" : "For-profit business"} Funding Purpose: ${intake.purpose || "general grant funding"} Overall Score: ${overall}/10 — ${cat.label} Section Scores: ${scoreList} Strongest Areas: ${strong} Priority Gaps: ${weak} Paragraph 1: Summarize the overall assessment, score, and what the readiness category means for this organization's ability to compete for grants. Paragraph 2: Highlight the top strengths and explain why those areas matter to funders. Paragraph 3: Identify the priority gaps and provide concrete, actionable next steps. Close with a professional recommendation to engage D B Pyoas & Associates LLC for consulting support.` }] }) }); const data = await res.json(); setAiReport(data.content?.[0]?.text || ""); } catch { setAiReport(""); } setAiLoading(false); } // ── STYLES ── const C = { navy:"#0d2340", blue:"#1a3a5c", gold:"#c9952a", slate:"#475569", light:"#f8fafc", border:"#e2e8f0" }; const s = { wrap: { fontFamily:"'Segoe UI',system-ui,sans-serif", maxWidth:780, margin:"0 auto", padding:"16px", color:"#1a2a3a", minHeight:"100vh" }, hdr: { background:`linear-gradient(135deg, ${C.navy} 0%, ${C.blue} 100%)`, color:"#fff", borderRadius:14, padding:"28px 32px", marginBottom:20, textAlign:"center" }, card: { background:"#fff", border:`1px solid ${C.border}`, borderRadius:12, padding:"26px 28px", marginBottom:16, boxShadow:"0 2px 8px rgba(0,0,0,0.05)" }, btn: { background:C.blue, color:"#fff", border:"none", borderRadius:8, padding:"11px 26px", fontSize:14, fontWeight:700, cursor:"pointer" }, btnGold: { background:C.gold, color:"#fff", border:"none", borderRadius:8, padding:"11px 26px", fontSize:14, fontWeight:700, cursor:"pointer" }, btnOut: { background:"transparent", color:C.blue, border:`2px solid ${C.blue}`, borderRadius:8, padding:"9px 22px", fontSize:14, fontWeight:700, cursor:"pointer" }, inp: { width:"100%", padding:"9px 13px", border:`1.5px solid ${C.border}`, borderRadius:8, fontSize:14, boxSizing:"border-box", marginTop:5, outline:"none" }, tag: (c,bg) => ({ display:"inline-block", background:bg, color:c, padding:"4px 14px", borderRadius:20, fontWeight:700, fontSize:13 }), }; // ── STEP 0: WELCOME ── if (step === 0) return (
D B Pyoas & Associates LLC

Grant Readiness Assessment

Find out if your organization is ready to pursue, win, and manage grant funding

What This Assessment Does

This structured 30-question tool evaluates your organization across six critical readiness domains. In under 10 minutes, you'll receive a personalized readiness score, domain-by-domain performance dashboard, gap analysis, and a recommended 30-60-90 day action plan — all generated by D B Pyoas & Associates LLC's evidence-based readiness framework.

{[["📋","30 Questions","Covering 6 key domains"],["📊","Instant Score","1–10 readiness rating"],["🎯","Action Plan","Personalized next steps"]].map(([icon,title,sub]) => (
{icon}
{title}
{sub}
))}
D B Pyoas & Associates LLC · Wake Forest, NC · dbpyoas.com · 25+ years · $60M+ secured · 85% success rate
); // ── STEP 1: ORG TYPE ── if (step === 1) return (
D B Pyoas & Associates LLC

Grant Readiness Assessment

Select Your Organization Type

Nonprofit and for-profit entities are evaluated differently by funders. Select the pathway that matches your organization.

{[ { type:"nonprofit", icon:"🏛️", title:"Nonprofit Organization", desc:"501(c)(3) or fiscally sponsored entities pursuing charitable grant funding" }, { type:"forprofit", icon:"🏢", title:"For-Profit Business", desc:"Businesses pursuing innovation, economic development, procurement, or reimbursement-based grants" } ].map(opt => (
setOrgType(opt.type)} style={{ border:`2.5px solid ${orgType===opt.type ? C.blue : C.border}`, borderRadius:12, padding:20, cursor:"pointer", background:orgType===opt.type ? "#f0f5ff" : "#fff", transition:"all 0.15s" }}>
{opt.icon}
{opt.title}
{opt.desc}
))}
); // ── STEP 2: INTAKE ── if (step === 2) return (
D B Pyoas & Associates LLC

Organization Information

Please provide basic information about your organization. This helps personalize your readiness report.

{[ { k:"orgName", label:`${orgType==="nonprofit"?"Organization":"Business"} Name`, ph:"Enter full legal name" }, { k:"contact", label:"Primary Contact", ph:"Name and title" }, { k:"budget", label:"Annual Operating Budget", ph:"e.g. $250,000" }, { k:"purpose", label:"Funding Need", ph:"Briefly describe the project or program you seek grant funding for" } ].map(f => (
setIntake(p => ({ ...p, [f.k]:e.target.value }))} />
))}
); // ── STEPS 3–8: SURVEY SECTIONS ── if (step >= 3 && step <= 8) { const sec = sections[step - 3]; const pct = ((step - 3) / 6) * 100; const LABELS = ["Not in place","Informal/Partial","Mostly in place","Fully documented"]; const COLORS = ["#b83232","#d4600a","#c9952a","#2d7a4f"]; const BG = ["#fde8e8","#fef1e6","#fef7e0","#e6f4ec"]; return (
Section {step-2} of 6

{sec.title}

{sec.critical &&
⚡ Critical Domain
}
{/* Progress */}
{Math.round(pct)}% complete
Rate each statement:  0 = Not in place  ·  1 = Informal/Partial  ·  2 = Mostly in place  ·  3 = Fully documented
{sec.questions.map((q, qi) => { const val = answers[`${sec.id}q${qi}`]; return (

{qi+1}. {q}

{[0,1,2,3].map(n => ( ))}
); })}
); } // ── STEP 9: RESULTS ── if (step === 9 && scores) { const overall = scores.overall; const cat = readinessCat(overall); const sorted = [...scores.sections].sort((a, b) => b.score10 - a.score10); const strengths = sorted.slice(0, 2); const gaps = sorted.slice(-2).reverse(); const critFail = scores.sections.filter(s => s.critical && s.avg < 2.0); // Service recommendations const svcMap = ["Legal & Eligibility Review","Governance Strengthening Package","Financial Packaging & Budget Development","Program Design & Logic Model Package","Data & Evaluation Framework","Grant Prospect Research & Proposal Development"]; const svcs = scores.sections.map((s,i) => s.score10 < 7.0 ? svcMap[i] : null).filter(Boolean); if (!svcs.length) svcs.push("Full Proposal Development Package","Grant Prospect Research Package"); // Action plan const a30=[], a60=[], a90=[]; scores.sections.forEach(s => { if (s.score10 < 5.0) a30.push(`Address critical gap in ${s.title}`); else if (s.score10 < 7.0) a60.push(`Strengthen ${s.title}`); else a90.push(`Leverage ${s.title} as a competitive asset in targeted proposals`); }); if (!a30.length) a30.push("Review all readiness documentation for currency and completeness."); if (!a60.length) a60.push("Begin targeted funder research and develop a grant calendar."); if (!a90.length) a90.push("Engage D B Pyoas & Associates LLC to build your active grant pipeline."); const barW = (score10) => `${(score10/10)*100}%`; return (
D B Pyoas & Associates LLC

Grant Readiness Report

{intake.orgName || "Your Organization"}

{/* Score Banner */}
Overall Readiness Score
{overall}
/ 10
{cat.label}
{critFail.length > 0 && (
⚠️ Conditional Flag: {critFail.map(s=>s.title).join(", ")} scored below the critical threshold (2.0 avg). Corrective action is required before pursuing major grant opportunities.
)}
{/* Domain Dashboard */}

Domain Score Dashboard

{scores.sections.map((sec,i) => { const t = tl(sec.score10); return (
{sec.title}{sec.critical&&⚡critical}
{t.label} {sec.score10}/10
); })}
{/* AI Executive Summary */}

Executive Summary

{aiLoading ? (
Generating your personalized assessment narrative…
) : aiReport ? (
{aiReport}
) : (
Based on an overall score of {overall}/10, your organization is rated {cat.label}. Review the domain dashboard above for specific strengths and areas requiring attention before pursuing grant opportunities.
)}
{/* Strengths + Gaps */}

✅ Top Strengths

{strengths.map((sec,i) => (
{sec.title}
{sec.score10} / 10
))}

⚠️ Priority Gaps

{gaps.map((sec,i) => (
{sec.title}
{sec.score10} / 10
))}
{/* Action Plan */}

Recommended 30-60-90 Day Action Plan

{[ { label:"0–30 Days", color:"#b83232", bg:"#fde8e8", items:a30 }, { label:"31–60 Days", color:"#c9952a", bg:"#fef7e0", items:a60 }, { label:"61–90 Days", color:"#2d7a4f", bg:"#e6f4ec", items:a90 } ].map((phase,i) => (
{phase.label}
{phase.items.map((item,j) => (
• {item}
))}
))}
{/* CTA Card */}

Recommended Services — D B Pyoas & Associates LLC

Based on your assessment results, the following services would most strengthen your grant competitiveness:

{svcs.map((sv,i) => (
✓ {sv}
))}

D B Pyoas & Associates LLC has secured more than $60 million in funding for 400+ organizations over 25 years, with an 85% grant success rate. We are ready to help you move from readiness to results.

); } return null; }