mirror of
https://github.com/tiennm99/ai-labs.git
synced 2026-10-14 22:17:13 +00:00
feat(01-03): create PeopleList component
- Subscribes to store.people signal - Renders list of person names with unique keys - Shows empty state when no people added - Preact Signals auto-track dependencies in components
This commit is contained in:
1 parent
92a4e631bf
commit
c3d7a36249
1 file changed
+17
@@ -0,0 +1,17 @@
|
||||
import { store } from '../../store/billStore.js';
|
||||
|
||||
export function PeopleList() {
|
||||
const people = store.people.value;
|
||||
|
||||
if (people.length === 0) {
|
||||
return <p class="empty-state">No people added yet</p>;
|
||||
}
|
||||
|
||||
return (
|
||||
<ul class="people-list">
|
||||
{people.map((person) => (
|
||||
<li key={person.id}>{person.name}</li>
|
||||
))}
|
||||
</ul>
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user