diff --git a/frontend/app/(sidebar)/data-pipeline/page.tsx b/frontend/app/(sidebar)/data-pipeline/page.tsx index a5bf45d..ccbb4b5 100644 --- a/frontend/app/(sidebar)/data-pipeline/page.tsx +++ b/frontend/app/(sidebar)/data-pipeline/page.tsx @@ -4,7 +4,6 @@ import PageHeader from "@/components/page-header"; import { PipelineCard } from "@/components/pipeline/card"; import { Button } from "@/components/ui/button"; import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs"; -import { listPipelines } from "@/lib/api/pipelines"; import { Pipeline } from "@/lib/api/pipelines/types"; import { Plus } from "lucide-react"; import Link from "next/link"; @@ -16,8 +15,8 @@ export default function DataPipelinePage() { useEffect(() => { const fetchPipelines = async () => { try { - const data = await listPipelines(); - setPipelines(data); + // const data = await listPipelines(); + // setPipelines(data); } catch (err) { console.error("Error fetching pipelines:", err); setError("Failed to load pipelines"); diff --git a/frontend/components/pipeline/add-data-source.tsx b/frontend/components/pipeline/add-data-source.tsx index 90ea018..1a67714 100644 --- a/frontend/components/pipeline/add-data-source.tsx +++ b/frontend/components/pipeline/add-data-source.tsx @@ -1,4 +1,5 @@ import { DatabaseIcon, FileUp, Globe, Plus, Trash2 } from "lucide-react"; +import { useState } from "react"; import { Accordion, AccordionContent, @@ -18,7 +19,144 @@ import { Input } from "../ui/input"; import { Label } from "../ui/label"; import { Textarea } from "../ui/textarea"; +type SourceType = "website" | "file" | "api"; + +type Source = { + id: string; + type: SourceType; +}; + export function AddDataSource() { + const [sources, setSources] = useState([ + { id: "source-1", type: "website" }, + { id: "source-2", type: "file" }, + { id: "source-3", type: "api" }, + ]); + + const addSource = (type: SourceType) => { + const newId = `source-${Date.now()}`; + setSources((prev) => [...prev, { id: newId, type }]); + }; + + const removeSource = (id: string) => { + setSources((prev) => prev.filter((source) => source.id !== id)); + }; + + const renderSourceItem = (source: Source) => { + const commonProps = { + className: "border rounded-md mb-4 data-source-card", + value: source.id, + }; + + return ( + + +
+ {source.type === "website" && ( + + )} + {source.type === "file" && ( + + )} + {source.type === "api" && ( + + )} + {`${ + source.type.charAt(0).toUpperCase() + source.type.slice(1) + } Source`} +
+
+ + {source.type === "website" && ( +
+
+ + +
+
+
+ + + Pattern Detection + +
+