Index: pages/+Layout.telefunc.ts
===================================================================
--- pages/+Layout.telefunc.ts	(revision b69759dc4c8f1a000afc0d0c5c5afcc6868641fb)
+++ pages/+Layout.telefunc.ts	(revision 5ce5904505744192d6f836fac3fea6ddf058d6ea)
@@ -4,14 +4,40 @@
 
 export async function getAuthenticationState() {
-    const c = getAuthState();
+    const context = getAuthState();
 
-    return c;
+    return context;
 }
 
-export async function getPopupAllComponents({ componentType, q, limit }
-                                            : { componentType?: string; q?: string; limit?: number }) {
+export async function getPopupAllComponents({ componentType, limit, q }
+                                            : { componentType?: string; limit?: number; q?: string }) {
     const c = ctx();
 
-    // getAllComponents
+    const components = await drizzleQueries.getAllComponents(c.db, limit, q, componentType);
+
+    return components;
+}
+
+export async function getPopupComponentDetails({ componentId }
+                                           : { componentId: number }) {
+    const context = ctx();
+
+    if(!Number.isInteger(componentId) || componentId <= 0) throw Abort();
+
+    const componentDetails = await drizzleQueries.getComponentDetails(context.db, componentId);
+
+    if(!componentDetails) throw Abort();
+
+    return componentDetails;
+}
+
+export async function getPopupSuggestComponent({ link, description, componentType }
+                                               : { link: string; description: string; componentType: string }) {
+    const { c, userId } = requireUser()
+
+    const newSuggestionId = await drizzleQueries.addComponentSuggestion(c.db, userId, link, description, componentType);
+
+    if(!newSuggestionId) throw Abort();
+
+    return newSuggestionId;
 }
 
@@ -38,9 +64,9 @@
 export async function getPopupBuildDetails({ buildId }
                                            : { buildId: number }) {
-    const context = ctx();
+    const context = getAuthState();
 
     if(!Number.isInteger(buildId) || buildId <= 0) throw Abort();
 
-    const buildDetails = await drizzleQueries.getBuildDetails(context.db, buildId);
+    const buildDetails = await drizzleQueries.getBuildDetails(context.db, buildId, context.userId ?? undefined);
 
     if(!buildDetails) throw Abort();
@@ -65,4 +91,6 @@
 
     if (!Number.isInteger(buildId) || buildId <= 0) throw Abort();
+
+    if (!Number.isInteger(value) || value < 1 || value > 5) throw Abort();
 
     const result = await drizzleQueries.setBuildRating(c.db, userId, buildId, value);
