- {people.map((person, index) => {
- if (person.name.toLowerCase() === current_user.toLowerCase()) {
+ {loading ? (
+
+ {Array.from({ length: 6 }).map((_, i) => (
+
+ ))}
+
+
+ ) : filteredPeople.length === 0 ? (
+
+ ) : (
+
+ {filteredPeople.map((person, index) => {
+ if (person.name.toLowerCase() === current_user.toLowerCase()) {
+ return (
+
+
{person.name}
+
+ {person.opinion.length} opinion(s)
+
+
+ );
+ }
+
return (
{
}}
>
{person.name}
+
+ {person.opinion.length} opinion(s)
+
);
- }
-
- return (
-
-
{person.name}
-
- );
- })}
-
+ })}
+
+ )}
);
};
diff --git a/frontend/src/components/EmptyState.tsx b/frontend/src/components/EmptyState.tsx
new file mode 100644
index 0000000..7b20e71
--- /dev/null
+++ b/frontend/src/components/EmptyState.tsx
@@ -0,0 +1,91 @@
+import type { ReactNode } from "react";
+
+interface EmptyStateProps {
+ icon?: string;
+ title: string;
+ description?: string;
+ action?: ReactNode;
+}
+
+export function EmptyState({ icon = "📭", title, description, action }: EmptyStateProps) {
+ return (
+