/* global React */
const { useState: useStateAdmin } = React;
/* Admin Console mock, browser window chrome + sidebar + content */
function AdminChrome({ url = 'admin.verveli.org/approvals', children }) {
return (
);
}
function AdminSidebar({ active = 'approvals' }) {
const items = [
{ id: 'home', label: 'Home', group: null, ic: 'home', badge: null },
{ id: 'approvals', label: 'Approvals', group: 'People', ic: 'check', badge: '24' },
{ id: 'members', label: 'Members', group: null, ic: 'users', badge: null },
{ id: 'programs', label: 'Programs', group: null, ic: 'layers', badge: null },
{ id: 'chapters', label: 'Chapters', group: null, ic: 'grid', badge: null },
{ id: 'contacts', label: 'Contacts', group: null, ic: 'card', badge: null },
{ id: 'opps', label: 'Opportunities', group: 'Content', ic: 'briefcase',badge: null },
{ id: 'updates', label: 'Updates', group: null, ic: 'mega', badge: null },
{ id: 'today', label: 'Daily content', group: null, ic: 'sun', badge: null },
{ id: 'world', label: 'World settings',group: 'Institute', ic: 'sliders', badge: null },
{ id: 'audit', label: 'Audit log', group: null, ic: 'history', badge: null },
];
const icons = {
home: ,
check: ,
users: ,
layers: ,
grid: ,
card: ,
briefcase: ,
mega: ,
sun: ,
sliders: ,
history: ,
};
// Group by group header
const out = [];
let currentGroup = null;
items.forEach((it) => {
if (it.group && it.group !== currentGroup) {
out.push({it.group}
);
currentGroup = it.group;
}
out.push(
{icons[it.ic]}
{it.label}
{it.badge && {it.badge}}
);
});
return (
Northbridge · Admin
{out}
);
}
/* ---------- Approvals view ---------- */
function AdminApprovals() {
const rows = [
{ name: 'Ananya Bose', meta: 'Batch ’17 · Postdoc · MIT', status: 'Pending verify', color: '' },
{ name: 'Karan Mehta', meta: 'Batch ’08 · Partner · Mumbai', status: 'Email matched', color: 'green' },
{ name: 'R. Subramanian',meta: 'Batch ’96 · Civil Service · Chennai', status: 'Phone verified', color: 'blue' },
{ name: 'P. Krishnan', meta: 'Batch ’21 · Junior eng · Pune', status: 'Awaiting referral', color: 'pink' },
{ name: 'Vinay Iyer', meta: 'Batch ’14 · Founder · Bengaluru', status: 'Email matched', color: 'green' },
{ name: 'Meera Joseph', meta: 'Batch ’03 · Faculty · institute', status: 'Pending verify', color: '' },
];
return (
Approvals
24 awaiting review · queue resets daily
Member
Identity check
Source
Batch
Action
{rows.map((r, i) => (
{r.status}
{i % 2 === 0 ? 'Code · NB-A14' : 'Coordinator'}
{r.meta.split('·')[0].trim()}
))}
Showing 6 of 24
Auto-approve disabled by World Setting
);
}
/* ---------- Audit log view ---------- */
function AdminAudit() {
const rows = [
{ t: '11:42', kind: 'approve', who: 'M. Pillai', what: <>Approved Ananya Bose ’17 · joined via institute code NB-A14> },
{ t: '11:31', kind: 'update', who: 'R. Menon', what: <>Published update “Convocation 2026 dates” to all members> },
{ t: '10:58', kind: 'setting', who: 'S. Hari', what: <>Changed world setting auto-approve from on to off> },
{ t: '10:14', kind: 'signal', who: 'A. Iyer', what: <>Posted a hiring signal in Founders & Operators> },
{ t: '09:46', kind: 'approve', who: 'M. Pillai', what: <>Verified Karan Mehta ’08 by email domain match> },
{ t: '09:12', kind: 'update', who: 'EC chair', what: <>Created chapter SF Bay Area, assigned lead S. Krishnan> },
{ t: '08:55', kind: 'setting', who: 'S. Hari', what: <>Updated privacy default to phone hidden from non-batch> },
];
return (
Audit log
Today · Mon 18 Nov
{rows.map((r, i) => (
{r.t}
{r.kind}
{r.what}
{r.who}
))}
Every action is logged. Logs are retained per institute policy.
Live · 7 events today
);
}
Object.assign(window, { AdminApprovals, AdminAudit });