// ===== PWD ASSISTANCE (Persons With Disabilities) =====
const pwd_services = [
{ id: 1, title: 'Request On-Road Assistance', desc: 'Alert nearby responders & LGU desks that a PWD needs help at your location.', icon: '๐ค', color: '#2556a8', cta: 'Request help' },
{ id: 2, title: 'Accessible Route Finder', desc: 'Routes with curb ramps, footbrid-free crossings, and step-free transfers.', icon: 'โฟ', color: '#00c48c', cta: 'Find route' },
{ id: 3, title: 'PWD Parking Locator', desc: 'Nearest reserved PWD parking bays with live availability.', icon: '๐
ฟ๏ธ', color: '#7b2d8b', cta: 'View map' },
{ id: 4, title: 'Priority Emergency Response', desc: 'Your PWD profile is shared with responders for faster, tailored help.', icon: '๐', color: '#ff4757', cta: 'Set up' },
];
const pwd_hotlines = [
{ id: 1, name: 'NCDA (National Council on Disability Affairs)', num: '(02) 8932 6422', desc: 'PWD concerns & assistance', icon: '๐๏ธ', color: '#2556a8' },
{ id: 2, name: 'DOH PWD Health Assistance', num: '1555', desc: 'Medical & accessibility support', icon: '๐ฅ', color: '#00c48c' },
{ id: 3, name: 'Emergency Hotline', num: '911', desc: 'Police ยท Fire ยท Medical', icon: '๐จ', color: '#ff4757' },
];
function PWDScreen({ t, go, user, updateUser }) {
const u = user || {};
const a11y = u.a11y || {};
const [toast, setToast] = useState('');
const note = (m) => { setToast(m); setTimeout(() => setToast(''), 2000); };
const toggle = (key, label) => {
const next = { ...a11y, [key]: !a11y[key] };
updateUser({ a11y: next });
note(`${label} ${next[key] ? 'on' : 'off'}`);
};
const registered = !!u.pwdId;
// ----- Accessible ride booking -----
const [booking, setBooking] = useState(false);
const [bk, setBk] = useState({ from: '', to: '', date: '', time: '', vehicle: 'wheelchair', companion: false, notes: '' });
const setF = (k, v) => setBk(s => ({ ...s, [k]: v }));
const [confirmed, setConfirmed] = useState(null);
const bkReady = bk.from.trim() && bk.to.trim() && bk.date && bk.time;
const vehicles = [
{ id: 'wheelchair', label: 'Wheelchair van', icon: 'โฟ', desc: 'Hydraulic lift ยท secures 1 chair' },
{ id: 'stretcher', label: 'Stretcher unit', icon: '๐', desc: 'Reclining transport' },
{ id: 'standard', label: 'Assisted sedan', icon: '๐', desc: 'Trained driver-assist' },
];
const confirmBooking = () => {
const ref = 'RIDE-' + Math.floor(100000 + Math.random() * 900000);
setConfirmed({ ...bk, ref });
setBooking(false);
};
const closeConfirm = () => { setConfirmed(null); setBk({ from: '', to: '', date: '', time: '', vehicle: 'wheelchair', companion: false, notes: '' }); };
const fieldStyle = { width: '100%', border: `1.5px solid ${t.border}`, background: t.inputBg, color: t.text, borderRadius: 12, padding: '12px 13px', outline: 'none', fontWeight: 500, fontSize: 14 };
const labelStyle = { fontSize: 12, fontWeight: 700, color: t.text, display: 'block', marginBottom: 6 };
const options = [
{ key: 'bigText', icon: '๐ค', label: 'Larger text', desc: 'Increase font size across the app' },
{ key: 'highContrast', icon: '๐', label: 'High contrast', desc: 'Boost color contrast for readability' },
{ key: 'voice', icon: '๐', label: 'Voice guidance', desc: 'Spoken prompts & screen reading' },
{ key: 'reduceMotion', icon: '๐ข', label: 'Reduce motion', desc: 'Minimize animations & transitions' },
{ key: 'haptics', icon: '๐ณ', label: 'Strong haptics', desc: 'Stronger vibration feedback' },
];
return (
{toast &&
{toast}
}
{/* Hero */}
โฟ
PWD Assistance
Accessibility tools and priority support for Persons With Disabilities, in line with RA 7277 (Magna Carta for PWDs).
{/* PWD ID card / registration */}
{registered ? (
REPUBLIC OF THE PHILIPPINES ยท PWD ID
{u.name || 'PWD Member'}
{u.pwdId}
โฟ
Verified ยท priority assistance enabled
) : (
Register your PWD ID
Link your DOH/LGU-issued PWD ID to unlock priority emergency response and tailored assistance.
{ updateUser({ pwdId: 'PWD-NCR-' + Math.floor(100000 + Math.random() * 900000) }); note('PWD ID registered'); }}>
Register PWD ID
)}
{/* Featured: Book accessible ride */}
{/* Services */}
Assistance Services
{pwd_services.map(s => (
note(`${s.title} โ request sent`)}>{s.cta}
))}
{/* Accessibility settings */}
Accessibility Settings
{options.map((o, i) => {
const on = !!a11y[o.key];
return (
0 ? `1px solid ${t.border}` : 'none' }}>
);
})}
{/* Hotlines */}
PWD Support Hotlines
{pwd_hotlines.map(h => (
))}
{/* ===== Booking sheet ===== */}
{booking && (
setBooking(false)} style={{ position: 'fixed', inset: 0, background: 'rgba(0,0,0,0.45)', zIndex: 70, display: 'flex', alignItems: 'flex-end', animation: 'screenIn 0.2s ease' }}>
e.stopPropagation()} style={{ width: '100%', maxWidth: 430, margin: '0 auto', background: t.bg, borderTopLeftRadius: 26, borderTopRightRadius: 26, padding: '10px 18px max(20px, env(safe-area-inset-bottom))', maxHeight: '92%', overflowY: 'auto' }}>
๐
Book Accessible Ride
Specialized PWD vehicle ยท door-to-door
{/* Route A โ B */}
{/* Date + time */}
{/* Vehicle type */}
{vehicles.map(v => {
const sel = bk.vehicle === v.id;
return (
);
})}
{/* Companion + notes */}
bkReady && confirmBooking()} style={{ opacity: bkReady ? 1 : 0.5, minHeight: 52, fontSize: 15 }} icon="check">
{bkReady ? 'Confirm booking' : 'Fill in route, date & time'}
Free for registered PWDs within Metro Manila ยท subject to vehicle availability
)}
{/* ===== Confirmation ===== */}
{confirmed && (
e.stopPropagation()} style={{ width: '100%', maxWidth: 360, background: t.bg, borderRadius: 22, padding: 22, textAlign: 'center' }}>
Ride booked!
Your accessible ride is confirmed. A trained driver will contact you before pickup.
BOOKING REF
{confirmed.ref}
{[['From', confirmed.from], ['To', confirmed.to], ['Date', confirmed.date], ['Time', confirmed.time], ['Vehicle', vehicles.find(v => v.id === confirmed.vehicle)?.label]].map(([k, v]) => (
{k}
{v}
))}
Done
)}
);
}
Object.assign(window, { PWDScreen });