- {/* Dropdown component should be here */}
-
- All Sites
-
-
- {/* Dropdown component should be here */}
-
- All Times
-
-
+
+
+
)
diff --git a/src/components/ui/select.tsx b/src/components/ui/select.tsx
new file mode 100644
index 0000000..ebb98fc
--- /dev/null
+++ b/src/components/ui/select.tsx
@@ -0,0 +1,160 @@
+"use client"
+
+import * as React from "react"
+import * as SelectPrimitive from "@radix-ui/react-select"
+import { CheckIcon, ChevronDownIcon, ChevronUpIcon } from "@heroicons/react/24/outline"
+
+import { cn } from "../../utils"
+
+const Select = SelectPrimitive.Root
+
+const SelectGroup = SelectPrimitive.Group
+
+const SelectValue = SelectPrimitive.Value
+
+const SelectTrigger = React.forwardRef<
+ React.ElementRef
,
+ React.ComponentPropsWithoutRef
+>(({ className, children, ...props }, ref) => (
+ span]:line-clamp-1",
+ className
+ )}
+ {...props}
+ >
+ {children}
+
+
+
+
+))
+SelectTrigger.displayName = SelectPrimitive.Trigger.displayName
+
+const SelectScrollUpButton = React.forwardRef<
+ React.ElementRef,
+ React.ComponentPropsWithoutRef
+>(({ className, ...props }, ref) => (
+
+
+
+))
+SelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName
+
+const SelectScrollDownButton = React.forwardRef<
+ React.ElementRef,
+ React.ComponentPropsWithoutRef
+>(({ className, ...props }, ref) => (
+
+
+
+))
+SelectScrollDownButton.displayName =
+ SelectPrimitive.ScrollDownButton.displayName
+
+const SelectContent = React.forwardRef<
+ React.ElementRef,
+ React.ComponentPropsWithoutRef
+>(({ className, children, position = "popper", ...props }, ref) => (
+
+
+
+
+ {children}
+
+
+
+
+))
+SelectContent.displayName = SelectPrimitive.Content.displayName
+
+const SelectLabel = React.forwardRef<
+ React.ElementRef,
+ React.ComponentPropsWithoutRef
+>(({ className, ...props }, ref) => (
+
+))
+SelectLabel.displayName = SelectPrimitive.Label.displayName
+
+const SelectItem = React.forwardRef<
+ React.ElementRef,
+ React.ComponentPropsWithoutRef
+>(({ className, children, ...props }, ref) => (
+
+
+
+
+
+
+
+ {children}
+
+))
+SelectItem.displayName = SelectPrimitive.Item.displayName
+
+const SelectSeparator = React.forwardRef<
+ React.ElementRef,
+ React.ComponentPropsWithoutRef
+>(({ className, ...props }, ref) => (
+
+))
+SelectSeparator.displayName = SelectPrimitive.Separator.displayName
+
+export {
+ Select,
+ SelectGroup,
+ SelectValue,
+ SelectTrigger,
+ SelectContent,
+ SelectLabel,
+ SelectItem,
+ SelectSeparator,
+ SelectScrollUpButton,
+ SelectScrollDownButton,
+}
diff --git a/src/lib/feed.ts b/src/lib/feed.ts
index 2cdbe0f..1e5a353 100644
--- a/src/lib/feed.ts
+++ b/src/lib/feed.ts
@@ -39,11 +39,27 @@ export async function fetchFeedData({
}
}
- const articles = await prisma.article.findMany({
- ...query,
- skip: current,
- take: next,
- });
+ // Mocking the data instead of fetching from the database
+ const articles: Article[] = [
+ {
+ id: 1,
+ title: "Mock Article 1",
+ slug: "This is a mock article.",
+ siteKey: "asdas",
+ url: "asdasd",
+ createdAt: new Date(),
+ updatedAt: new Date(),
+ },
+ {
+ id: 2,
+ title: "Mock Article 2",
+ slug: "This is a mock article.",
+ siteKey: "asdas",
+ url: "asdasd",
+ createdAt: new Date(),
+ updatedAt: new Date(),
+ },
+ ];
const nextPointer = articles.length >= limit ? next + limit : null;
diff --git a/src/utils.ts b/src/utils.ts
index 0e79ec0..ccd14b1 100644
--- a/src/utils.ts
+++ b/src/utils.ts
@@ -1,4 +1,11 @@
import { formatDistanceToNow } from "date-fns"
+import { clsx, type ClassValue } from "clsx"
+import { twMerge } from "tailwind-merge"
+
+export function cn(...inputs: ClassValue[]) {
+ return twMerge(clsx(inputs))
+}
+
// Utility function to format dates
export const formatDate = (date: string | Date) => {
@@ -36,3 +43,4 @@ export async function getResults({
}
]
}
+