Index: database/drizzle/queries/components.ts
===================================================================
--- database/drizzle/queries/components.ts	(revision 1ebac59c4e102e653ac1aa7c4322403d97397ecc)
+++ database/drizzle/queries/components.ts	(revision 226fbbbab48f243ba6045007157b751910cdc7fb)
@@ -1,14 +1,53 @@
 import type { Database } from "../db";
-import { componentsTable, suggestionsTable } from "../schema";
+import {buildsTable, componentsTable } from "../schema";
+import {and, desc, eq, ilike} from "drizzle-orm";
 
-export async function getComponentSuggestions(db: Database) {
+export async function getAllComponents(db: Database, limit?: number,  q?: string, componentType?: string) {
+    let queryConditions = [];
 
+    if (q) {
+        queryConditions.push(
+            ilike(componentsTable.name, `%${q}%`)
+        );
+    }
+
+    if(componentType && componentType.trim() !== 'all') {
+        queryConditions.push(
+            eq(componentsTable.type, componentType.trim().toLowerCase())
+        );
+    }
+
+    const componentsList = await db
+        .select({
+            id: componentsTable.id,
+            name: componentsTable.name,
+            brand: componentsTable.brand,
+            price: componentsTable.price,
+        })
+        .from(componentsTable)
+        .where(
+            queryConditions.length > 0 ?
+                and (
+                    ...queryConditions
+                )
+                : undefined
+        )
+        .orderBy(
+            desc(componentsTable.price)
+        )
+        .limit(limit || 100); // 100 placeholder
+
+    return componentsList;
 }
 
-export async function setComponentSuggestionStatus(db: Database, suggestionId: number, status: string, adminComment: string) {
+export async function getComponentDetails(db: Database, componentId: number) {
+    const [componentDetails] = await db
+        .select()
+        .from(componentsTable)
+        .where(
+            eq(componentsTable.id, componentId)
+        )
+        .limit(1);
 
+    return componentDetails ?? null;
 }
-
-export async function getAllComponents(db: Database, componentType?: string, q?: string, page?: number, pageSize?: number) {
-
-}
