// List + Detail pane — multi-comptes, multi-2FA, copy buttons, TOTP countdown.
const Avatar = ({ entry, size = 32 }) => {
const initial = entry.name.charAt(0).toUpperCase();
return (
{initial}
);
};
const StrengthDot = ({ level }) => {
const colors = { weak: '#EF4444', medium: '#F59E0B', strong: '#10B981' };
return ;
};
const PasswordList = ({ entries, selected, onSelect, sort, onSort, query, onQuery, count, title, onAdd, onAddWifi }) => {
const [addOpen, setAddOpen] = React.useState(false);
const addRef = React.useRef(null);
React.useEffect(() => {
if (!addOpen) return;
const onDoc = (e) => { if (addRef.current && !addRef.current.contains(e.target)) setAddOpen(false); };
document.addEventListener('mousedown', onDoc);
return () => document.removeEventListener('mousedown', onDoc);
}, [addOpen]);
return (
{title}
{count} élément{count > 1 ? 's' : ''}
{addOpen && (
)}
onQuery(e.target.value)}
/>
⌘K
{entries.length === 0 && (
)}
{entries.map(entry => (
onSelect(entry.id)}
>
{entry.type === 'wifi' ? (
) :
}
{entry.name}
{entry.type === 'wifi' && (
Wi-Fi
)}
{entry.totp && entry.totp.length > 0 && (
2FA
)}
{entry.accounts.length > 1 && entry.type !== 'wifi' && (
{entry.accounts.length}
)}
{entry.type === 'wifi' ? entry.ssid : entry.accounts[0].username}
{entry.shared &&
}
))}
);
};
window.PasswordList = PasswordList;
window.Avatar = Avatar;