YC (S26) | Open Computer History | Continuously record your company computer work, map your workflows, help you find work worth automating, and power your agents' context
Rust agentsagiaiai-memoryaudio-recordingcomputer-visionhermeshermes-agentllmlocal-ailocal-firstmachine-learningmcpmultimodalopenclawprivacyrewindscreen-recordingspeech-to-textycombinator
feat: data viewer table for screenpipe data (#980)
neo7732b56d7da987c
diff --git a/pipes/data-table/.gitignore b/pipes/data-table/.gitignorenew file mode 100644index 000000000..5ef6a5207--- /dev/null+++ b/pipes/data-table/.gitignore@@ -0,0 +1,41 @@+# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.++# dependencies+/node_modules+/.pnp+.pnp.*+.yarn/*+!.yarn/patches+!.yarn/plugins+!.yarn/releases+!.yarn/versions++# testing+/coverage++# next.js+/.next/+/out/++# production+/build++# misc+.DS_Store+*.pem++# debug+npm-debug.log*+yarn-debug.log*+yarn-error.log*+.pnpm-debug.log*++# env files (can opt-in for committing if needed)+.env*++# vercel+.vercel++# typescript+*.tsbuildinfo+next-env.d.tsdiff --git a/pipes/data-table/README.md b/pipes/data-table/README.mdnew file mode 100644index 000000000..e215bc4cc--- /dev/null+++ b/pipes/data-table/README.md@@ -0,0 +1,36 @@+This is a [Next.js](https://nextjs.org) project bootstrapped with [`create-next-app`](https://nextjs.org/docs/app/api-reference/cli/create-next-app).++## Getting Started++First, run the development server:++```bash+npm run dev+# or+yarn dev+# or+pnpm dev+# or+bun dev+```++Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.++You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file.++This project uses [`next/font`](https://nextjs.org/docs/app/building-your-application/optimizing/fonts) to automatically optimize and load [Geist](https://vercel.com/font), a new font family for Vercel.++## Learn More++To learn more about Next.js, take a look at the following resources:++- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.+- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.++You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js) - your feedback and contributions are welcome!++## Deploy on Vercel++The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.++Check out our [Next.js deployment documentation](https://nextjs.org/docs/app/building-your-application/deploying) for more details.diff --git a/pipes/data-table/bun.lockb b/pipes/data-table/bun.lockbnew file mode 100755index 000000000..20020c857Binary files /dev/null and b/pipes/data-table/bun.lockb differdiff --git a/pipes/data-table/components.json b/pipes/data-table/components.jsonnew file mode 100644index 000000000..d710b4962--- /dev/null+++ b/pipes/data-table/components.json@@ -0,0 +1,21 @@+{+ "$schema": "https://ui.shadcn.com/schema.json",+ "style": "default",+ "rsc": true,+ "tsx": true,+ "tailwind": {+ "config": "tailwind.config.ts",+ "css": "src/app/globals.css",+ "baseColor": "neutral",+ "cssVariables": true,+ "prefix": ""+ },+ "aliases": {+ "components": "@/components",+ "utils": "@/lib/utils",+ "ui": "@/components/ui",+ "lib": "@/lib",+ "hooks": "@/hooks"+ },+ "iconLibrary": "lucide"+}\ No newline at end of filediff --git a/pipes/data-table/eslint.config.mjs b/pipes/data-table/eslint.config.mjsnew file mode 100644index 000000000..c85fb67c4--- /dev/null+++ b/pipes/data-table/eslint.config.mjs@@ -0,0 +1,16 @@+import { dirname } from "path";+import { fileURLToPath } from "url";+import { FlatCompat } from "@eslint/eslintrc";++const __filename = fileURLToPath(import.meta.url);+const __dirname = dirname(__filename);++const compat = new FlatCompat({+ baseDirectory: __dirname,+});++const eslintConfig = [+ ...compat.extends("next/core-web-vitals", "next/typescript"),+];++export default eslintConfig;diff --git a/pipes/data-table/next.config.ts b/pipes/data-table/next.config.tsnew file mode 100644index 000000000..b3978a6a4--- /dev/null+++ b/pipes/data-table/next.config.ts@@ -0,0 +1,16 @@+import type { NextConfig } from "next";++const nextConfig: NextConfig = {+ transpilePackages: ["@screenpipe/js"],+ webpack: (config, { isServer }) => {+ config.resolve.alias = {+ ...config.resolve.alias,+ "@screenpipe/js": isServer+ ? "@screenpipe/js/dist/node.js"+ : "@screenpipe/js/dist/browser.js",+ };+ return config;+ },+};++export default nextConfig;diff --git a/pipes/data-table/package.json b/pipes/data-table/package.jsonnew file mode 100644index 000000000..ee8cca511--- /dev/null+++ b/pipes/data-table/package.json@@ -0,0 +1,70 @@+{+ "name": "data-table",+ "version": "0.1.0",+ "private": true,+ "scripts": {+ "dev": "next dev --turbopack",+ "build": "next build",+ "start": "next start",+ "lint": "next lint"+ },+ "dependencies": {+ "@radix-ui/react-accordion": "^1.2.2",+ "@radix-ui/react-checkbox": "^1.1.3",+ "@radix-ui/react-dialog": "^1.1.3",+ "@radix-ui/react-dropdown-menu": "^2.1.3",+ "@radix-ui/react-label": "^2.1.1",+ "@radix-ui/react-popover": "^1.1.3",+ "@radix-ui/react-progress": "^1.1.1",+ "@radix-ui/react-select": "^2.1.3",+ "@radix-ui/react-separator": "^1.1.1",+ "@radix-ui/react-slider": "^1.2.2",+ "@radix-ui/react-slot": "^1.1.1",+ "@radix-ui/react-switch": "^1.1.2",+ "@radix-ui/react-toast": "^1.2.3",+ "@radix-ui/react-tooltip": "^1.1.5",+ "@screenpipe/js": "0.1.10-beta.18",+ "@shadcn/ui": "^0.0.4",+ "@tanstack/react-query": "^5.62.7",+ "@tanstack/react-table": "^8.20.6",+ "@types/js-levenshtein": "^1.1.3",+ "@types/lodash": "^4.17.13",+ "@types/react-syntax-highlighter": "^15.5.13",+ "ai": "^4.0.18",+ "class-variance-authority": "^0.7.1",+ "clsx": "^2.1.1",+ "cmdk": "1.0.0",+ "date-fns": "^4.1.0",+ "framer-motion": "^11.14.4",+ "install": "^0.13.0",+ "js-levenshtein": "^1.1.6",+ "localforage": "^1.10.0",+ "lodash": "^4.17.21",+ "lucide-react": "^0.468.0",+ "magic-ui": "^0.1.0",+ "next": "15.1.0",+ "npm": "^10.9.2",+ "openai": "^4.76.3",+ "react": "^19.0.0",+ "react-day-picker": "8.10.1",+ "react-dom": "^19.0.0",+ "react-markdown": "^9.0.1",+ "react-syntax-highlighter": "^15.6.1",+ "remark-gfm": "^4.0.0",+ "remark-math": "^6.0.0",+ "tailwind-merge": "^2.5.5",+ "tailwindcss-animate": "^1.0.7"+ },+ "devDependencies": {+ "@eslint/eslintrc": "^3",+ "@types/node": "^22.10.2",+ "@types/react": "^19",+ "@types/react-dom": "^19",+ "autoprefixer": "^10.4.20",+ "eslint": "^9",+ "eslint-config-next": "15.1.0",+ "postcss": "^8.4.49",+ "tailwindcss": "^3.4.16",+ "typescript": "^5"+ }+}diff --git a/pipes/data-table/postcss.config.mjs b/pipes/data-table/postcss.config.mjsnew file mode 100644index 000000000..1a69fd2a4--- /dev/null+++ b/pipes/data-table/postcss.config.mjs@@ -0,0 +1,8 @@+/** @type {import('postcss-load-config').Config} */+const config = {+ plugins: {+ tailwindcss: {},+ },+};++export default config;diff --git a/pipes/data-table/public/file.svg b/pipes/data-table/public/file.svgnew file mode 100644index 000000000..004145cdd--- /dev/null+++ b/pipes/data-table/public/file.svg@@ -0,0 +1 @@+<svg fill="none" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><path d="M14.5 13.5V5.41a1 1 0 0 0-.3-.7L9.8.29A1 1 0 0 0 9.08 0H1.5v13.5A2.5 2.5 0 0 0 4 16h8a2.5 2.5 0 0 0 2.5-2.5m-1.5 0v-7H8v-5H3v12a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1M9.5 5V2.12L12.38 5zM5.13 5h-.62v1.25h2.12V5zm-.62 3h7.12v1.25H4.5zm.62 3h-.62v1.25h7.12V11z" clip-rule="evenodd" fill="#666" fill-rule="evenodd"/></svg>\ No newline at end of filediff --git a/pipes/data-table/public/globe.svg b/pipes/data-table/public/globe.svgnew file mode 100644index 000000000..567f17b0d--- /dev/null+++ b/pipes/data-table/public/globe.svg@@ -0,0 +1 @@+<svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><g clip-path="url(#a)"><path fill-rule="evenodd" clip-rule="evenodd" d="M10.27 14.1a6.5 6.5 0 0 0 3.67-3.45q-1.24.21-2.7.34-.31 1.83-.97 3.1M8 16A8 8 0 1 0 8 0a8 8 0 0 0 0 16m.48-1.52a7 7 0 0 1-.96 0H7.5a4 4 0 0 1-.84-1.32q-.38-.89-.63-2.08a40 40 0 0 0 3.92 0q-.25 1.2-.63 2.08a4 4 0 0 1-.84 1.31zm2.94-4.76q1.66-.15 2.95-.43a7 7 0 0 0 0-2.58q-1.3-.27-2.95-.43a18 18 0 0 1 0 3.44m-1.27-3.54a17 17 0 0 1 0 3.64 39 39 0 0 1-4.3 0 17 17 0 0 1 0-3.64 39 39 0 0 1 4.3 0m1.1-1.17q1.45.13 2.69.34a6.5 6.5 0 0 0-3.67-3.44q.65 1.26.98 3.1M8.48 1.5l.01.02q.41.37.84 1.31.38.89.63 2.08a40 40 0 0 0-3.92 0q.25-1.2.63-2.08a4 4 0 0 1 .85-1.32 7 7 0 0 1 .96 0m-2.75.4a6.5 6.5 0 0 0-3.67 3.44 29 29 0 0 1 2.7-.34q.31-1.83.97-3.1M4.58 6.28q-1.66.16-2.95.43a7 7 0 0 0 0 2.58q1.3.27 2.95.43a18 18 0 0 1 0-3.44m.17 4.71q-1.45-.12-2.69-.34a6.5 6.5 0 0 0 3.67 3.44q-.65-1.27-.98-3.1" fill="#666"/></g><defs><clipPath id="a"><path fill="#fff" d="M0 0h16v16H0z"/></clipPath></defs></svg>\ No newline at end of filediff --git a/pipes/data-table/public/next.svg b/pipes/data-table/public/next.svgnew file mode 100644index 000000000..5174b28c5--- /dev/null+++ b/pipes/data-table/public/next.svg@@ -0,0 +1 @@+<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 394 80"><path fill="#000" d="M262 0h68.5v12.7h-27.2v66.6h-13.6V12.7H262V0ZM149 0v12.7H94v20.4h44.3v12.6H94v21h55v12.6H80.5V0h68.7zm34.3 0h-17.8l63.8 79.4h17.9l-32-39.7 32-39.6h-17.9l-23 28.6-23-28.6zm18.3 56.7-9-11-27.1 33.7h17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1.5 5h-5.8z"/></svg>\ No newline at end of filediff --git a/pipes/data-table/public/vercel.svg b/pipes/data-table/public/vercel.svgnew file mode 100644index 000000000..770539603--- /dev/null+++ b/pipes/data-table/public/vercel.svg@@ -0,0 +1 @@+<svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1155 1000"><path d="m577.3 0 577.4 1000H0z" fill="#fff"/></svg>\ No newline at end of filediff --git a/pipes/data-table/public/window.svg b/pipes/data-table/public/window.svgnew file mode 100644index 000000000..b2b2a44f6--- /dev/null+++ b/pipes/data-table/public/window.svg@@ -0,0 +1 @@+<svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill-rule="evenodd" clip-rule="evenodd" d="M1.5 2.5h13v10a1 1 0 0 1-1 1h-11a1 1 0 0 1-1-1zM0 1h16v11.5a2.5 2.5 0 0 1-2.5 2.5h-11A2.5 2.5 0 0 1 0 12.5zm3.75 4.5a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5M7 4.75a.75.75 0 1 1-1.5 0 .75.75 0 0 1 1.5 0m1.75.75a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5" fill="#666"/></svg>\ No newline at end of filediff --git a/pipes/data-table/src/app/api/settings/route.ts b/pipes/data-table/src/app/api/settings/route.tsnew file mode 100644index 000000000..8d4a2b4fc--- /dev/null+++ b/pipes/data-table/src/app/api/settings/route.ts@@ -0,0 +1,80 @@+// app/api/settings/route.ts+import { pipe } from "@screenpipe/js";+import { NextResponse } from "next/server";+import type { Settings } from "@screenpipe/js";+// Force Node.js runtime+export const runtime = "nodejs"; // Add this line+export const dynamic = 'force-dynamic'++export async function GET() {+ const defaultSettings: Settings = {+ openaiApiKey: "",+ deepgramApiKey: "",+ aiModel: "gpt-4",+ aiUrl: "https://api.openai.com/v1",+ customPrompt: "",+ port: 3030,+ dataDir: "default",+ disableAudio: false,+ ignoredWindows: [],+ includedWindows: [],+ aiProviderType: "openai",+ embeddedLLM: {+ enabled: false,+ model: "llama3.2:1b-instruct-q4_K_M",+ port: 11438,+ },+ enableFrameCache: true,+ enableUiMonitoring: false,+ aiMaxContextChars: 128000,+ };++ try {+ const settingsManager = pipe.settings;+ if (!settingsManager) {+ throw new Error("settingsManager not found");+ }+ const rawSettings = await settingsManager.getAll();+ return NextResponse.json(rawSettings);+ } catch (error) {+ console.error("failed to get settings:", error);+ return NextResponse.json(defaultSettings);+ }+}++export async function PUT(request: Request) {+ try {+ const settingsManager = pipe.settings;+ if (!settingsManager) {+ throw new Error("settingsManager not found");+ }++ const body = await request.json();+ const { key, value, isPartialUpdate, reset } = body;++ if (reset) {+ if (key) {+ await settingsManager.resetKey(key);+ } else {+ await settingsManager.reset();+ }+ return NextResponse.json({ success: true });+ }++ if (isPartialUpdate) {+ const serializedSettings = JSON.parse(JSON.stringify(value));+ await settingsManager.update(serializedSettings);+ } else {+ const serializedValue = JSON.parse(JSON.stringify(value));+ await settingsManager.set(key, serializedValue);+ }++ return NextResponse.json({ success: true });+ } catch (error) {+ console.error("failed to update settings:", error);+ return NextResponse.json(+ { error: "failed to update settings" },+ { status: 500 }+ );+ }+}diff --git a/pipes/data-table/src/app/favicon.ico b/pipes/data-table/src/app/favicon.iconew file mode 100644index 000000000..718d6fea4Binary files /dev/null and b/pipes/data-table/src/app/favicon.ico differdiff --git a/pipes/data-table/src/app/globals.css b/pipes/data-table/src/app/globals.cssnew file mode 100644index 000000000..a23ac26b0--- /dev/null+++ b/pipes/data-table/src/app/globals.css@@ -0,0 +1,72 @@+@tailwind base;+@tailwind components;+@tailwind utilities;++body {+ font-family: Arial, Helvetica, sans-serif;+}++@layer base {+ :root {+ --background: 0 0% 100%;+ --foreground: 0 0% 3.9%;+ --card: 0 0% 100%;+ --card-foreground: 0 0% 3.9%;+ --popover: 0 0% 100%;+ --popover-foreground: 0 0% 3.9%;+ --primary: 0 0% 9%;+ --primary-foreground: 0 0% 98%;+ --secondary: 0 0% 96.1%;+ --secondary-foreground: 0 0% 9%;+ --muted: 0 0% 96.1%;+ --muted-foreground: 0 0% 45.1%;+ --accent: 0 0% 96.1%;+ --accent-foreground: 0 0% 9%;+ --destructive: 0 84.2% 60.2%;+ --destructive-foreground: 0 0% 98%;+ --border: 0 0% 89.8%;+ --input: 0 0% 89.8%;+ --ring: 0 0% 3.9%;+ --chart-1: 12 76% 61%;+ --chart-2: 173 58% 39%;+ --chart-3: 197 37% 24%;+ --chart-4: 43 74% 66%;+ --chart-5: 27 87% 67%;+ --radius: 0.5rem;+ }+ .dark {+ --background: 0 0% 3.9%;+ --foreground: 0 0% 98%;+ --card: 0 0% 3.9%;+ --card-foreground: 0 0% 98%;+ --popover: 0 0% 3.9%;+ --popover-foreground: 0 0% 98%;+ --primary: 0 0% 98%;+ --primary-foreground: 0 0% 9%;+ --secondary: 0 0% 14.9%;+ --secondary-foreground: 0 0% 98%;+ --muted: 0 0% 14.9%;+ --muted-foreground: 0 0% 63.9%;+ --accent: 0 0% 14.9%;+ --accent-foreground: 0 0% 98%;+ --destructive: 0 62.8% 30.6%;+ --destructive-foreground: 0 0% 98%;+ --border: 0 0% 14.9%;+ --input: 0 0% 14.9%;+ --ring: 0 0% 83.1%;+ --chart-1: 220 70% 50%;+ --chart-2: 160 60% 45%;+ --chart-3: 30 80% 55%;+ --chart-4: 280 65% 60%;+ --chart-5: 340 75% 55%;+ }+}++@layer base {+ * {+ @apply border-border;+ }+ body {+ @apply bg-background text-foreground;+ }+}diff --git a/pipes/data-table/src/app/layout.tsx b/pipes/data-table/src/app/layout.tsxnew file mode 100644index 000000000..140191d39--- /dev/null+++ b/pipes/data-table/src/app/layout.tsx@@ -0,0 +1,35 @@+import type { Metadata } from "next";+import { Geist, Geist_Mono } from "next/font/google";+import "./globals.css";++const geistSans = Geist({+ variable: "--font-geist-sans",+ subsets: ["latin"],+});++const geistMono = Geist_Mono({+ variable: "--font-geist-mono",+ subsets: ["latin"],+});+++export const metadata: Metadata = {+ title: "Create Next App",+ description: "Generated by create next app",+};++export default function RootLayout({+ children,+}: Readonly<{+ children: React.ReactNode;+}>) {+ return (+ <html lang="en">+ <body+ className={`${geistSans.variable} ${geistMono.variable} antialiased`}+ >+ {children}+ </body>+ </html>+ );+}diff --git a/pipes/data-table/src/app/page.tsx b/pipes/data-table/src/app/page.tsxnew file mode 100644index 000000000..19b9af3ac--- /dev/null+++ b/pipes/data-table/src/app/page.tsx@@ -0,0 +1,13 @@+// "use client";++import DataPage from "@/components/page";++export default function SearchPage() {++ return (+ <div className="flex flex-col gap-4 items-center justify-center h-full mt-12">+ <p className="text-xl font-bold">where pixels become magic</p>+ <DataPage />+ </div>+ );+}diff --git a/pipes/data-table/src/components/audio-transcriptions-table.tsx b/pipes/data-table/src/components/audio-transcriptions-table.tsxnew file mode 100644index 000000000..118250c8a--- /dev/null+++ b/pipes/data-table/src/components/audio-transcriptions-table.tsx@@ -0,0 +1,506 @@+"use client";++import * as React from "react";+import {+ ColumnDef,+ SortingState,+ VisibilityState,+ flexRender,+ getCoreRowModel,+ getSortedRowModel,+ useReactTable,+} from "@tanstack/react-table";+import {+ ArrowUpDown,+ ChevronDown,+ MoreHorizontal,+ RefreshCw,+} from "lucide-react";++import { Button } from "@/components/ui/button";+import {+ DropdownMenu,+ DropdownMenuCheckboxItem,+ DropdownMenuContent,+ DropdownMenuItem,+ DropdownMenuLabel,+ DropdownMenuTrigger,+} from "@/components/ui/dropdown-menu";+import { Input } from "@/components/ui/input";+import {+ Table,+ TableBody,+ TableCell,+ TableHead,+ TableHeader,+ TableRow,+} from "@/components/ui/table";+import { Badge } from "@/components/ui/badge";+import {+ Select,+ SelectContent,+ SelectGroup,+ SelectItem,+ SelectLabel,+ SelectTrigger,+ SelectValue,+} from "@/components/ui/select";++interface AudioTranscription {+ id: number;+ audio_chunk_id: number;+ offset_index: number;+ timestamp: string;+ transcription: string;+ device: string;+ is_input_device: boolean;+ speaker_id: number | null;+ transcription_engine: string;+}+interface AudioDevice {+ name: string;+ is_default: boolean;+}++const columns: ColumnDef<AudioTranscription>[] = [+ {+ accessorKey: "id",+ header: ({ column }) => {+ return (+ <Button+ variant="ghost"+ onClick={() => column.toggleSorting(column.getIsSorted() === "asc")}+ >+ ID+ <ArrowUpDown className="ml-2 h-4 w-4" />+ </Button>+ );+ },+ },+ {+ accessorKey: "timestamp",+ header: ({ column }) => {+ return (+ <Button+ variant="ghost"+ onClick={() => column.toggleSorting(column.getIsSorted() === "asc")}+ >+ Time+ <ArrowUpDown className="ml-2 h-4 w-4" />+ </Button>+ );+ },+ cell: ({ row }) => {+ const timestamp = new Date(row.getValue("timestamp"));+ return timestamp.toLocaleString();+ },+ },+ {+ accessorKey: "transcription",+ header: ({ column }) => {+ return (+ <Button+ variant="ghost"+ onClick={() => column.toggleSorting(column.getIsSorted() === "asc")}+ >+ Transcription+ <ArrowUpDown className="ml-2 h-4 w-4" />+ </Button>+ );+ },+ cell: ({ row }) => (+ <div className="max-w-[500px] truncate font-mono">+ {row.getValue("transcription")}+ </div>+ ),+ },+ {+ accessorKey: "device",+ header: "Device",+ cell: ({ row }) => (+ <Badge variant="outline">+ {row.getValue("device")}+ {row.original.is_input_device ? " (input)" : " (output)"}+ </Badge>+ ),+ },+ {+ accessorKey: "speaker_id",+ header: "Speaker",+ cell: ({ row }) => (+ <Badge variant="secondary">+ {row.getValue("speaker_id") ?? "unknown"}+ </Badge>+ ),+ },+ {+ accessorKey: "transcription_engine",+ header: "Engine",+ cell: ({ row }) => <Badge>{row.getValue("transcription_engine")}</Badge>,+ },+ {+ id: "actions",+ cell: ({ row }) => {+ const transcription = row.original;++ return (+ <DropdownMenu>+ <DropdownMenuTrigger asChild>+ <Button variant="ghost" className="h-8 w-8 p-0">+ <span className="sr-only">open menu</span>+ <MoreHorizontal className="h-4 w-4" />+ </Button>+ </DropdownMenuTrigger>+ <DropdownMenuContent align="end">+ <DropdownMenuLabel>actions</DropdownMenuLabel>+ <DropdownMenuItem+ onClick={() =>+ navigator.clipboard.writeText(transcription.transcription)+ }+ >+ copy text+ </DropdownMenuItem>+ <DropdownMenuItem+ onClick={() =>+ navigator.clipboard.writeText(+ JSON.stringify(transcription, null, 2)+ )+ }+ >+ copy raw data+ </DropdownMenuItem>+ </DropdownMenuContent>+ </DropdownMenu>+ );+ },+ },+];++export function AudioTranscriptionsTable() {+ const [data, setData] = React.useState<AudioTranscription[]>([]);+ const [sorting, setSorting] = React.useState<SortingState>([]);+ const [columnVisibility, setColumnVisibility] =+ React.useState<VisibilityState>({});+ const [isLoading, setIsLoading] = React.useState(false);+ const [error, setError] = React.useState<string | null>(null);++ const [pageSize, setPageSize] = React.useState(10);+ const [pageIndex, setPageIndex] = React.useState(0);+ const [totalRows, setTotalRows] = React.useState(0);++ const [transcriptionFilter, setTranscriptionFilter] = React.useState("");+ const [deviceFilter, setDeviceFilter] = React.useState("");+ const [availableAudioDevices, setAvailableAudioDevices] = React.useState<+ AudioDevice[]+ >([]);++ const fetchData = async () => {+ setIsLoading(true);+ setError(null);+ try {+ const filterClauses = [+ "transcription IS NOT NULL",+ transcriptionFilter+ ? `LOWER(transcription) LIKE '%${transcriptionFilter+ .toLowerCase()+ .replace(/'/g, "''")}%'`+ : null,+ deviceFilter+ ? `LOWER(device) LIKE '%${deviceFilter+ .toLowerCase()+ .replace(/'/g, "''")}%'`+ : null,+ ]+ .filter(Boolean)+ .join(" AND ");++ // Get total count first+ const countResponse = await fetch("http://localhost:3030/raw_sql", {+ method: "POST",+ headers: {+ "Content-Type": "application/json",+ },+ body: JSON.stringify({+ query: `+ SELECT COUNT(*) as total+ FROM audio_transcriptions+ WHERE ${filterClauses}+ `,+ }),+ });++ if (!countResponse.ok) {+ throw new Error("failed to fetch count");+ }++ const countResult = await countResponse.json();+ setTotalRows(countResult[0].total);++ // Then get the actual data+ const response = await fetch("http://localhost:3030/raw_sql", {+ method: "POST",+ headers: {+ "Content-Type": "application/json",+ },+ body: JSON.stringify({+ query: `+ SELECT+ id,+ audio_chunk_id,+ offset_index,+ timestamp,+ transcription,+ device,+ is_input_device,+ speaker_id,+ transcription_engine+ FROM audio_transcriptions+ WHERE ${filterClauses}+ ORDER BY timestamp DESC+ LIMIT ${pageSize}+ OFFSET ${pageIndex * pageSize}+ `,+ }),+ });++ if (!response.ok) {+ throw new Error("failed to fetch data");+ }+ const result = await response.json();+ setData(result);+ } catch (error) {+ console.error("error fetching data:", error);+ setError(+ `failed to load audio transcriptions: ${+ error instanceof Error ? error.message : "unknown error"+ }`+ );+ } finally {+ setIsLoading(false);+ }+ };+ const loadDevices = async () => {+ try {+ // Fetch audio devices+ const audioDevicesResponse = await fetch(+ "http://localhost:3030/audio/list"+ );+ if (!audioDevicesResponse.ok) {+ throw new Error("Failed to fetch audio devices");+ }+ const audioDevices: AudioDevice[] = await audioDevicesResponse.json();+ console.log("audioDevices", audioDevices);+ setAvailableAudioDevices(+ audioDevices.map((device) => ({+ name: device.name+ .replace("(input)", "")+ .replace("(default)", "")+ .trimEnd(),+ is_default: device.is_default,+ }))+ );+ } catch (error) {+ console.error("Failed to load devices:", error);+ }+ };+ React.useEffect(() => {+ const timer = setTimeout(() => {+ fetchData();+ }, 300);++ return () => clearTimeout(timer);+ }, [transcriptionFilter, deviceFilter, pageIndex, pageSize]);++ React.useEffect(() => {+ loadDevices();+ }, []);++ const table = useReactTable({+ data,+ columns,+ onSortingChange: setSorting,+ getCoreRowModel: getCoreRowModel(),+ manualPagination: true,+ manualFiltering: true,+ pageCount: Math.ceil(totalRows / pageSize),+ onPaginationChange: (updater) => {+ if (typeof updater === "function") {+ const newState = updater({+ pageIndex,+ pageSize,+ });+ setPageIndex(newState.pageIndex);+ setPageSize(newState.pageSize);+ }+ },+ getSortedRowModel: getSortedRowModel(),+ onColumnVisibilityChange: setColumnVisibility,+ state: {+ sorting,+ columnVisibility,+ pagination: {+ pageIndex,+ pageSize,+ },+ },+ });++ return (+ <div className="w-full">+ <div className="flex items-center justify-between py-4">+ <div className="flex items-center space-x-4">+ <Input+ placeholder="filter transcription..."+ value={transcriptionFilter}+ onChange={(event) => {+ setTranscriptionFilter(event.target.value);+ setPageIndex(0);+ }}+ className="max-w-sm"+ />+ {availableAudioDevices.length > 0 && (+ <Select+ value={deviceFilter}+ onValueChange={(value) => {+ setDeviceFilter(value);+ setPageIndex(0);+ }}+ >+ <SelectTrigger className="w-[200px]">+ <SelectValue placeholder="filter by device..." />+ </SelectTrigger>+ <SelectContent>+ <SelectGroup>+ <SelectLabel>audio devices</SelectLabel>+ {availableAudioDevices.map((device) => (+ <SelectItem key={device.name} value={device.name}>+ {device.name} {device.is_default && "(default)"}+ </SelectItem>+ ))}+ </SelectGroup>+ </SelectContent>+ </Select>+ )}++ <Button+ variant="outline"+ size="icon"+ onClick={fetchData}+ disabled={isLoading}+ >+ <RefreshCw+ className={`h-4 w-4 ${isLoading ? "animate-spin" : ""}`}+ />+ </Button>+ </div>+ <DropdownMenu>+ <DropdownMenuTrigger asChild>+ <Button variant="outline">+ columns <ChevronDown className="ml-2 h-4 w-4" />+ </Button>+ </DropdownMenuTrigger>+ <DropdownMenuContent align="end">+ {table+ .getAllColumns()+ .filter((column) => column.getCanHide())+ .map((column) => {+ return (+ <DropdownMenuCheckboxItem+ key={column.id}+ className="capitalize"+ checked={column.getIsVisible()}+ onCheckedChange={(value) =>+ column.toggleVisibility(!!value)+ }+ >+ {column.id}+ </DropdownMenuCheckboxItem>+ );+ })}+ </DropdownMenuContent>+ </DropdownMenu>+ </div>+ {error ? (+ <div className="text-center text-red-500 py-4">{error}</div>+ ) : (+ <div className="rounded-md border">+ <Table>+ <TableHeader>+ {table.getHeaderGroups().map((headerGroup) => (+ <TableRow key={headerGroup.id}>+ {headerGroup.headers.map((header) => {+ return (+ <TableHead key={header.id}>+ {header.isPlaceholder+ ? null+ : flexRender(+ header.column.columnDef.header,+ header.getContext()+ )}+ </TableHead>+ );+ })}+ </TableRow>+ ))}+ </TableHeader>+ <TableBody>+ {isLoading ? (+ <TableRow>+ <TableCell+ colSpan={columns.length}+ className="h-24 text-center"+ >+ loading...+ </TableCell>+ </TableRow>+ ) : table.getRowModel().rows?.length ? (+ table.getRowModel().rows.map((row) => (+ <TableRow+ key={row.id}+ data-state={row.getIsSelected() && "selected"}+ >+ {row.getVisibleCells().map((cell) => (+ <TableCell key={cell.id}>+ {flexRender(+ cell.column.columnDef.cell,+ cell.getContext()+ )}+ </TableCell>+ ))}+ </TableRow>+ ))+ ) : (+ <TableRow>+ <TableCell+ colSpan={columns.length}+ className="h-24 text-center"+ >+ no results.+ </TableCell>+ </TableRow>+ )}+ </TableBody>+ </Table>+ </div>+ )}+ <div className="flex items-center justify-end space-x-2 py-4">+ <Button+ variant="outline"+ size="sm"+ onClick={() => table.previousPage()}+ disabled={!table.getCanPreviousPage()}+ >+ previous+ </Button>+ <Button+ variant="outline"+ size="sm"+ onClick={() => table.nextPage()}+ disabled={!table.getCanNextPage()}+ >+ next+ </Button>+ </div>+ </div>+ );+}diff --git a/pipes/data-table/src/components/database-sidebar.tsx b/pipes/data-table/src/components/database-sidebar.tsxnew file mode 100644index 000000000..5a632701f--- /dev/null+++ b/pipes/data-table/src/components/database-sidebar.tsx@@ -0,0 +1,51 @@+"use client"++import { Button } from "@/components/ui/button"+import { cn } from "@/lib/utils"+import { Database } from "lucide-react"+import { JSX } from "react"++interface TableItem {+ name: string+ icon: JSX.Element+}++const tables: TableItem[] = [+ { name: "ui_monitoring", icon: <Database className="h-4 w-4" /> },+ { name: "video_chunks", icon: <Database className="h-4 w-4" /> },+ { name: "ocr_text", icon: <Database className="h-4 w-4" /> },+ { name: "audio_transcriptions", icon: <Database className="h-4 w-4" /> },+]++interface DatabaseSidebarProps {+ currentTable: string+ onTableSelect: (table: string) => void+}++export function DatabaseSidebar({ currentTable, onTableSelect }: DatabaseSidebarProps) {+ return (+ <div className="pb-12 w-64 border-r">+ <div className="space-y-4 py-4">+ <div className="px-3 py-2">+ <h2 className="mb-2 px-4 text-lg font-semibold">database tables</h2>+ <div className="space-y-1">+ {tables.map((table) => (+ <Button+ key={table.name}+ variant={currentTable === table.name ? "secondary" : "ghost"}+ className={cn(+ "w-full justify-start",+ currentTable === table.name && "bg-muted"+ )}+ onClick={() => onTableSelect(table.name)}+ >+ {table.icon}+ <span className="ml-2">{table.name}</span>+ </Button>+ ))}+ </div>+ </div>+ </div>+ </div>+ )+}\ No newline at end of filediff --git a/pipes/data-table/src/components/ocr-data-table.tsx b/pipes/data-table/src/components/ocr-data-table.tsxnew file mode 100644index 000000000..2aab69a63--- /dev/null+++ b/pipes/data-table/src/components/ocr-data-table.tsx@@ -0,0 +1,460 @@+"use client";++import * as React from "react";+import {+ ColumnDef,+ SortingState,+ VisibilityState,+ flexRender,+ getCoreRowModel,+ getSortedRowModel,+ useReactTable,+} from "@tanstack/react-table";+import {+ AppWindow,+ ArrowUpDown,+ ChevronDown,+ MoreHorizontal,+ RefreshCw,+} from "lucide-react";++import { Button } from "@/components/ui/button";+import {+ DropdownMenu,+ DropdownMenuCheckboxItem,+ DropdownMenuContent,+ DropdownMenuItem,+ DropdownMenuLabel,+ DropdownMenuTrigger,+} from "@/components/ui/dropdown-menu";+import { Input } from "@/components/ui/input";+import {+ Table,+ TableBody,+ TableCell,+ TableHead,+ TableHeader,+ TableRow,+} from "@/components/ui/table";+import { Badge } from "@/components/ui/badge";+import { SqlAutocompleteInput } from "./sql-autocomplete-input";++interface OcrText {+ frame_id: number;+ text: string;+ text_json: string | null;+ app_name: string;+ ocr_engine: string;+ window_name: string | null;+ focused: boolean;+}++const columns: ColumnDef<OcrText>[] = [+ {+ accessorKey: "frame_id",+ header: ({ column }) => {+ return (+ <Button+ variant="ghost"+ onClick={() => column.toggleSorting(column.getIsSorted() === "asc")}+ >+ Frame ID+ <ArrowUpDown className="ml-2 h-4 w-4" />+ </Button>+ );+ },+ },+ {+ accessorKey: "text",+ header: ({ column }) => {+ return (+ <Button+ variant="ghost"+ onClick={() => column.toggleSorting(column.getIsSorted() === "asc")}+ >+ Text Content+ <ArrowUpDown className="ml-2 h-4 w-4" />+ </Button>+ );+ },+ cell: ({ row }) => (+ <div className="max-w-[500px] truncate font-mono">+ {row.getValue("text")}+ </div>+ ),+ },+ {+ accessorKey: "app_name",+ header: ({ column }) => {+ return (+ <Button+ variant="ghost"+ onClick={() => column.toggleSorting(column.getIsSorted() === "asc")}+ >+ Application+ <ArrowUpDown className="ml-2 h-4 w-4" />+ </Button>+ );+ },+ cell: ({ row }) => (+ <Badge variant="outline">{row.getValue("app_name")}</Badge>+ ),+ },+ {+ accessorKey: "window_name",+ header: ({ column }) => {+ return (+ <Button+ variant="ghost"+ onClick={() => column.toggleSorting(column.getIsSorted() === "asc")}+ >+ Window+ <ArrowUpDown className="ml-2 h-4 w-4" />+ </Button>+ );+ },+ cell: ({ row }) => (+ <div className="max-w-[200px] truncate">+ {row.getValue("window_name") || "N/A"}+ </div>+ ),+ },+ {+ accessorKey: "ocr_engine",+ header: "Engine",+ cell: ({ row }) => (+ <Badge variant="secondary">{row.getValue("ocr_engine")}</Badge>+ ),+ },+ {+ accessorKey: "focused",+ header: "Focused",+ cell: ({ row }) => (+ <Badge variant={row.getValue("focused") ? "default" : "outline"}>+ {row.getValue("focused") ? "yes" : "no"}+ </Badge>+ ),+ },+ {+ id: "actions",+ cell: ({ row }) => {+ const ocrText = row.original;++ return (+ <DropdownMenu>+ <DropdownMenuTrigger asChild>+ <Button variant="ghost" className="h-8 w-8 p-0">+ <span className="sr-only">open menu</span>+ <MoreHorizontal className="h-4 w-4" />+ </Button>+ </DropdownMenuTrigger>+ <DropdownMenuContent align="end">+ <DropdownMenuLabel>actions</DropdownMenuLabel>+ <DropdownMenuItem+ onClick={() => navigator.clipboard.writeText(ocrText.text)}+ >+ copy text+ </DropdownMenuItem>+ <DropdownMenuItem+ onClick={() =>+ navigator.clipboard.writeText(ocrText.text_json || "")+ }+ >+ copy json+ </DropdownMenuItem>+ <DropdownMenuItem+ onClick={() =>+ navigator.clipboard.writeText(JSON.stringify(ocrText, null, 2))+ }+ >+ copy raw data+ </DropdownMenuItem>+ </DropdownMenuContent>+ </DropdownMenu>+ );+ },+ },+];++export function OcrDataTable() {+ const [data, setData] = React.useState<OcrText[]>([]);+ const [sorting, setSorting] = React.useState<SortingState>([]);+ const [columnVisibility, setColumnVisibility] =+ React.useState<VisibilityState>({});+ const [isLoading, setIsLoading] = React.useState(false);+ const [error, setError] = React.useState<string | null>(null);++ const [pageSize, setPageSize] = React.useState(10);+ const [pageIndex, setPageIndex] = React.useState(0);+ const [totalRows, setTotalRows] = React.useState(0);++ const [textFilter, setTextFilter] = React.useState("");+ const [appFilter, setAppFilter] = React.useState("");++ const fetchData = async () => {+ setIsLoading(true);+ setError(null);+ try {+ const filterClauses = [+ "text IS NOT NULL",+ "trim(text) != ''",+ textFilter+ ? `LOWER(text) LIKE '%${textFilter+ .toLowerCase()+ .replace(/'/g, "''")}%'`+ : null,+ appFilter+ ? `LOWER(app_name) LIKE '%${appFilter+ .toLowerCase()+ .replace(/'/g, "''")}%'`+ : null,+ ]+ .filter(Boolean)+ .join(" AND ");++ const countResponse = await fetch("http://localhost:3030/raw_sql", {+ method: "POST",+ headers: {+ "Content-Type": "application/json",+ },+ body: JSON.stringify({+ query: `+ SELECT COUNT(*) as total+ FROM ocr_text+ WHERE ${filterClauses}+ `,+ }),+ });++ if (!countResponse.ok) {+ throw new Error("failed to fetch count");+ }++ const countResult = await countResponse.json();+ setTotalRows(countResult[0].total);++ const response = await fetch("http://localhost:3030/raw_sql", {+ method: "POST",+ headers: {+ "Content-Type": "application/json",+ },+ body: JSON.stringify({+ query: `+ SELECT+ frame_id,+ text,+ text_json,+ app_name,+ ocr_engine,+ window_name,+ focused+ FROM ocr_text+ WHERE ${filterClauses}+ ORDER BY frame_id DESC+ LIMIT ${pageSize}+ OFFSET ${pageIndex * pageSize}+ `,+ }),+ });+ if (!response.ok) {+ throw new Error("failed to fetch data");+ }+ const result = await response.json();+ setData(result);+ } catch (error) {+ console.error("error fetching data:", error);+ setError(+ `failed to load ocr data: ${+ error instanceof Error ? error.message : "unknown error"+ }`+ );+ } finally {+ setIsLoading(false);+ }+ };++ React.useEffect(() => {+ const timer = setTimeout(() => {+ fetchData();+ }, 300);++ return () => clearTimeout(timer);+ }, [textFilter, appFilter, pageIndex, pageSize]);++ const table = useReactTable({+ data,+ columns,+ onSortingChange: setSorting,+ getCoreRowModel: getCoreRowModel(),+ manualPagination: true,+ manualFiltering: true,+ pageCount: Math.ceil(totalRows / pageSize),+ onPaginationChange: (updater) => {+ if (typeof updater === "function") {+ const newState = updater({+ pageIndex,+ pageSize,+ });+ setPageIndex(newState.pageIndex);+ setPageSize(newState.pageSize);+ }+ },+ getSortedRowModel: getSortedRowModel(),+ onColumnVisibilityChange: setColumnVisibility,+ state: {+ sorting,+ columnVisibility,+ pagination: {+ pageIndex,+ pageSize,+ },+ },+ });++ return (+ <div className="w-full">+ <div className="flex items-center justify-between py-4">+ <div className="flex items-center space-x-4">+ <Input+ placeholder="filter by text content..."+ value={textFilter}+ onChange={(event) => {+ setTextFilter(event.target.value);+ setPageIndex(0);+ }}+ className="max-w-sm"+ />+ <SqlAutocompleteInput+ id="appFilter"+ type="app"+ icon={<AppWindow className="h-4 w-4" />}+ value={appFilter}+ onChange={(value) => {+ setAppFilter(value);+ setPageIndex(0);+ }}+ placeholder="filter by app..."+ className="w-[300px]"+ />+ <Button+ variant="outline"+ size="icon"+ onClick={fetchData}+ disabled={isLoading}+ >+ <RefreshCw+ className={`h-4 w-4 ${isLoading ? "animate-spin" : ""}`}+ />+ </Button>+ </div>+ <DropdownMenu>+ <DropdownMenuTrigger asChild>+ <Button variant="outline">+ columns <ChevronDown className="ml-2 h-4 w-4" />+ </Button>+ </DropdownMenuTrigger>+ <DropdownMenuContent align="end">+ {table+ .getAllColumns()+ .filter((column) => column.getCanHide())+ .map((column) => {+ return (+ <DropdownMenuCheckboxItem+ key={column.id}+ className="capitalize"+ checked={column.getIsVisible()}+ onCheckedChange={(value) =>+ column.toggleVisibility(!!value)+ }+ >+ {column.id}+ </DropdownMenuCheckboxItem>+ );+ })}+ </DropdownMenuContent>+ </DropdownMenu>+ </div>+ {error ? (+ <div className="text-center text-red-500 py-4">{error}</div>+ ) : (+ <div className="rounded-md border">+ <Table>+ <TableHeader>+ {table.getHeaderGroups().map((headerGroup) => (+ <TableRow key={headerGroup.id}>+ {headerGroup.headers.map((header) => {+ return (+ <TableHead key={header.id}>+ {header.isPlaceholder+ ? null+ : flexRender(+ header.column.columnDef.header,+ header.getContext()+ )}+ </TableHead>+ );+ })}+ </TableRow>+ ))}+ </TableHeader>+ <TableBody>+ {isLoading ? (+ <TableRow>+ <TableCell+ colSpan={columns.length}+ className="h-24 text-center"+ >+ loading...+ </TableCell>+ </TableRow>+ ) : table.getRowModel().rows?.length ? (+ table.getRowModel().rows.map((row) => (+ <TableRow+ key={row.id}+ data-state={row.getIsSelected() && "selected"}+ >+ {row.getVisibleCells().map((cell) => (+ <TableCell key={cell.id}>+ {flexRender(+ cell.column.columnDef.cell,+ cell.getContext()+ )}+ </TableCell>+ ))}+ </TableRow>+ ))+ ) : (+ <TableRow>+ <TableCell+ colSpan={columns.length}+ className="h-24 text-center"+ >+ no results.+ </TableCell>+ </TableRow>+ )}+ </TableBody>+ </Table>+ </div>+ )}+ <div className="flex items-center justify-end space-x-2 py-4">+ <Button+ variant="outline"+ size="sm"+ onClick={() => table.previousPage()}+ disabled={!table.getCanPreviousPage()}+ >+ previous+ </Button>+ <Button+ variant="outline"+ size="sm"+ onClick={() => table.nextPage()}+ disabled={!table.getCanNextPage()}+ >+ next+ </Button>+ </div>+ </div>+ );+}diff --git a/pipes/data-table/src/components/page.tsx b/pipes/data-table/src/components/page.tsxnew file mode 100644index 000000000..5538ace0c--- /dev/null+++ b/pipes/data-table/src/components/page.tsx@@ -0,0 +1,43 @@+"use client"++import { useState } from "react"+import { DatabaseSidebar } from "./database-sidebar"+import { OcrDataTable } from "./ocr-data-table"+import { VideoChunksTable } from "./video-chunks-table"+import { AudioTranscriptionsTable } from "./audio-transcriptions-table"+import { UiMonitoringTable } from "./ui-monitoring-table"++export default function DataPage() {+ const [currentTable, setCurrentTable] = useState("ocr_text")++ const renderTable = () => {+ switch (currentTable) {+ case "ocr_text":+ return <OcrDataTable />+ case "video_chunks":+ return <VideoChunksTable />+ case "audio_transcriptions":+ return <AudioTranscriptionsTable />+ case "ui_monitoring":+ return <UiMonitoringTable />+ default:+ return <div>select a table</div>+ }+ }++ return (+ <div className="flex h-screen w-full">+ <div className="w-[20%]">+ <DatabaseSidebar+ currentTable={currentTable}+ onTableSelect={setCurrentTable}+ />+ </div>+ <div className="w-[80%] p-8">+ <div className="w-full">+ {renderTable()}+ </div>+ </div>+ </div>+ )+}\ No newline at end of filediff --git a/pipes/data-table/src/components/sql-autocomplete-input.tsx b/pipes/data-table/src/components/sql-autocomplete-input.tsxnew file mode 100644index 000000000..55807bebf--- /dev/null+++ b/pipes/data-table/src/components/sql-autocomplete-input.tsx@@ -0,0 +1,150 @@+import React, { useState, useRef, useCallback, useEffect } from "react";+import { useSqlAutocomplete } from "@/lib/hooks/use-sql-autocomplete";+import { Command } from "cmdk";+import { Input } from "@/components/ui/input";+import { Loader2, Search, X } from "lucide-react";+import { cn } from "@/lib/utils";++interface SqlAutocompleteInputProps {+ id: string;+ placeholder: string;+ value: string;+ onChange: (value: string) => void;+ type: "app" | "window";+ icon?: React.ReactNode;+ className?: string;+ onKeyDown?: (e: React.KeyboardEvent<HTMLInputElement>) => void;+}++export function SqlAutocompleteInput({+ id,+ placeholder,+ value,+ onChange,+ type,+ icon,+ className,+ onKeyDown,+}: SqlAutocompleteInputProps) {+ const { items, isLoading } = useSqlAutocomplete(type);+ const [open, setOpen] = useState(false);+ const [inputValue, setInputValue] = useState(value);+ const inputRef = useRef<HTMLInputElement>(null);+ const commandRef = useRef<HTMLDivElement>(null);++ // update local state when prop changes+ useEffect(() => {+ setInputValue(value);+ }, [value]);++ const handleSelect = (selectedValue: string) => {+ onChange(selectedValue);+ setInputValue(selectedValue);+ setOpen(false);+ inputRef.current?.focus();+ };++ const handleInputChange = useCallback(+ (e: React.ChangeEvent<HTMLInputElement>) => {+ const newValue = e.target.value;+ setInputValue(newValue);+ onChange(newValue);+ },+ [onChange]+ );++ const handleClearInput = useCallback(() => {+ setInputValue("");+ onChange("");+ inputRef.current?.focus();+ }, [onChange]);++ useEffect(() => {+ const handleClickOutside = (event: MouseEvent) => {+ if (+ commandRef.current &&+ !commandRef.current.contains(event.target as Node)+ ) {+ setOpen(false);+ }+ };++ document.addEventListener("mousedown", handleClickOutside);+ return () => {+ document.removeEventListener("mousedown", handleClickOutside);+ };+ }, []);++ return (+ <div className={cn("relative", className)} ref={commandRef}>+ <div className="absolute left-2 top-1/2 transform -translate-y-1/2 text-gray-400 z-10 flex items-center">+ {icon}+ <span className="w-2" />+ </div>+ <Command className="relative w-full" shouldFilter={false}>+ <div className="relative">+ <Input+ ref={inputRef}+ id={id}+ type="text"+ placeholder={placeholder}+ value={inputValue}+ onChange={handleInputChange}+ onFocus={() => setOpen(true)}+ className={cn("pr-8 w-full", icon ? "pl-7" : "pl-3")}+ autoCorrect="off"+ aria-autocomplete="none"+ onKeyDown={onKeyDown}+ />+ {inputValue && (+ <button+ onClick={handleClearInput}+ className="absolute right-2 top-1/2 transform -translate-y-1/2 text-gray-400 hover:text-gray-600"+ >+ <X className="h-4 w-4" />+ </button>+ )}+ </div>+ {open && (+ <Command.List className="absolute z-20 w-full bg-white border border-gray-300 rounded-md mt-1 max-h-60 overflow-auto shadow-lg text-sm">+ <div className="flex items-center px-3 py-2 border-b border-gray-200">+ <Search className="mr-2 h-4 w-4 text-gray-400" />+ <Command.Input+ placeholder="search..."+ value={inputValue}+ onValueChange={setInputValue}+ className="border-none focus:ring-0 outline-none w-full"+ />+ </div>+ {isLoading ? (+ <Command.Loading>+ <div className="px-4 py-2 text-gray-500 flex items-center">+ <Loader2 className="mr-2 h-4 w-4 animate-spin" />+ loading...+ </div>+ </Command.Loading>+ ) : (+ items+ .filter((item) =>+ item.name.toLowerCase().includes(inputValue.toLowerCase())+ )+ .map((item: any) => (+ <Command.Item+ key={item.name}+ value={item.name}+ onSelect={handleSelect}+ className="px-4 py-2 hover:bg-gray-100 cursor-pointer border-b border-gray-200 last:border-b-0"+ >+ {item.name} ({item.count})+ </Command.Item>+ ))+ )}+ {!isLoading && items.length === 0 && (+ <div className="px-4 py-2 text-gray-500">no results found</div>+ )}+ </Command.List>+ )}+ </Command>+ </div>+ );+}diff --git a/pipes/data-table/src/components/ui-monitoring-table.tsx b/pipes/data-table/src/components/ui-monitoring-table.tsxnew file mode 100644index 000000000..da05cad36--- /dev/null+++ b/pipes/data-table/src/components/ui-monitoring-table.tsx@@ -0,0 +1,453 @@+"use client";++import * as React from "react";+import {+ ColumnDef,+ SortingState,+ VisibilityState,+ flexRender,+ getCoreRowModel,+ getSortedRowModel,+ useReactTable,+} from "@tanstack/react-table";+import {+ AppWindow,+ ArrowUpDown,+ ChevronDown,+ MoreHorizontal,+ RefreshCw,+} from "lucide-react";++import { Button } from "@/components/ui/button";+import {+ DropdownMenu,+ DropdownMenuCheckboxItem,+ DropdownMenuContent,+ DropdownMenuItem,+ DropdownMenuLabel,+ DropdownMenuTrigger,+} from "@/components/ui/dropdown-menu";+import { Input } from "@/components/ui/input";+import {+ Table,+ TableBody,+ TableCell,+ TableHead,+ TableHeader,+ TableRow,+} from "@/components/ui/table";+import { Badge } from "@/components/ui/badge";+import { SqlAutocompleteInput } from "./sql-autocomplete-input";++interface UiMonitoring {+ id: number;+ text_output: string;+ timestamp: string;+ app: string;+ window: string;+ initial_traversal_at: string;+}++const columns: ColumnDef<UiMonitoring>[] = [+ {+ accessorKey: "id",+ header: ({ column }) => {+ return (+ <Button+ variant="ghost"+ onClick={() => column.toggleSorting(column.getIsSorted() === "asc")}+ >+ ID+ <ArrowUpDown className="ml-2 h-4 w-4" />+ </Button>+ );+ },+ },+ {+ accessorKey: "text_output",+ header: ({ column }) => {+ return (+ <Button+ variant="ghost"+ onClick={() => column.toggleSorting(column.getIsSorted() === "asc")}+ >+ Text Content+ <ArrowUpDown className="ml-2 h-4 w-4" />+ </Button>+ );+ },+ cell: ({ row }) => (+ <div className="max-w-[500px] truncate font-mono">+ {row.getValue("text_output")}+ </div>+ ),+ },+ {+ accessorKey: "app",+ header: ({ column }) => {+ return (+ <Button+ variant="ghost"+ onClick={() => column.toggleSorting(column.getIsSorted() === "asc")}+ >+ Application+ <ArrowUpDown className="ml-2 h-4 w-4" />+ </Button>+ );+ },+ cell: ({ row }) => <Badge variant="outline">{row.getValue("app")}</Badge>,+ },+ {+ accessorKey: "window",+ header: ({ column }) => {+ return (+ <Button+ variant="ghost"+ onClick={() => column.toggleSorting(column.getIsSorted() === "asc")}+ >+ Window+ <ArrowUpDown className="ml-2 h-4 w-4" />+ </Button>+ );+ },+ cell: ({ row }) => (+ <div className="max-w-[200px] truncate">+ {row.getValue("window") || "N/A"}+ </div>+ ),+ },+ {+ accessorKey: "timestamp",+ header: ({ column }) => {+ return (+ <Button+ variant="ghost"+ onClick={() => column.toggleSorting(column.getIsSorted() === "asc")}+ >+ Timestamp+ <ArrowUpDown className="ml-2 h-4 w-4" />+ </Button>+ );+ },+ cell: ({ row }) => {+ const timestamp = new Date(row.getValue("timestamp"));+ return timestamp.toLocaleString();+ },+ },+ {+ id: "actions",+ cell: ({ row }) => {+ const uiMonitoring = row.original;++ return (+ <DropdownMenu>+ <DropdownMenuTrigger asChild>+ <Button variant="ghost" className="h-8 w-8 p-0">+ <span className="sr-only">open menu</span>+ <MoreHorizontal className="h-4 w-4" />+ </Button>+ </DropdownMenuTrigger>+ <DropdownMenuContent align="end">+ <DropdownMenuLabel>actions</DropdownMenuLabel>+ <DropdownMenuItem+ onClick={() =>+ navigator.clipboard.writeText(uiMonitoring.text_output)+ }+ >+ copy text+ </DropdownMenuItem>+ <DropdownMenuItem+ onClick={() =>+ navigator.clipboard.writeText(+ JSON.stringify(uiMonitoring, null, 2)+ )+ }+ >+ copy raw data+ </DropdownMenuItem>+ </DropdownMenuContent>+ </DropdownMenu>+ );+ },+ },+];++export function UiMonitoringTable() {+ const [data, setData] = React.useState<UiMonitoring[]>([]);+ const [sorting, setSorting] = React.useState<SortingState>([]);+ const [columnVisibility, setColumnVisibility] =+ React.useState<VisibilityState>({});+ const [isLoading, setIsLoading] = React.useState(false);+ const [error, setError] = React.useState<string | null>(null);++ const [pageSize, setPageSize] = React.useState(10);+ const [pageIndex, setPageIndex] = React.useState(0);+ const [totalRows, setTotalRows] = React.useState(0);++ const [textFilter, setTextFilter] = React.useState("");+ const [appFilter, setAppFilter] = React.useState("");++ const fetchData = async () => {+ setIsLoading(true);+ setError(null);+ try {+ const filterClauses = [+ "text_output IS NOT NULL",+ "trim(text_output) != ''",+ textFilter+ ? `LOWER(text_output) LIKE '%${textFilter+ .toLowerCase()+ .replace(/'/g, "''")}%'`+ : null,+ appFilter+ ? `LOWER(app) LIKE '%${appFilter.toLowerCase().replace(/'/g, "''")}%'`+ : null,+ ]+ .filter(Boolean)+ .join(" AND ");++ const countResponse = await fetch("http://localhost:3030/raw_sql", {+ method: "POST",+ headers: {+ "Content-Type": "application/json",+ },+ body: JSON.stringify({+ query: `+ SELECT COUNT(*) as total+ FROM ui_monitoring+ WHERE ${filterClauses}+ `,+ }),+ });++ if (!countResponse.ok) {+ throw new Error("failed to fetch count");+ }++ const countResult = await countResponse.json();+ setTotalRows(countResult[0].total);++ const response = await fetch("http://localhost:3030/raw_sql", {+ method: "POST",+ headers: {+ "Content-Type": "application/json",+ },+ body: JSON.stringify({+ query: `+ SELECT+ id,+ text_output,+ timestamp,+ app,+ window,+ initial_traversal_at+ FROM ui_monitoring+ WHERE ${filterClauses}+ ORDER BY id DESC+ LIMIT ${pageSize}+ OFFSET ${pageIndex * pageSize}+ `,+ }),+ });+ if (!response.ok) {+ throw new Error("failed to fetch data");+ }+ const result = await response.json();+ setData(result);+ } catch (error) {+ console.error("error fetching data:", error);+ setError(+ `failed to load ui monitoring data: ${+ error instanceof Error ? error.message : "unknown error"+ }`+ );+ } finally {+ setIsLoading(false);+ }+ };++ React.useEffect(() => {+ const timer = setTimeout(() => {+ fetchData();+ }, 300);++ return () => clearTimeout(timer);+ }, [textFilter, appFilter, pageIndex, pageSize]);++ const table = useReactTable({+ data,+ columns,+ onSortingChange: setSorting,+ getCoreRowModel: getCoreRowModel(),+ manualPagination: true,+ manualFiltering: true,+ pageCount: Math.ceil(totalRows / pageSize),+ onPaginationChange: (updater) => {+ if (typeof updater === "function") {+ const newState = updater({+ pageIndex,+ pageSize,+ });+ setPageIndex(newState.pageIndex);+ setPageSize(newState.pageSize);+ }+ },+ getSortedRowModel: getSortedRowModel(),+ onColumnVisibilityChange: setColumnVisibility,+ state: {+ sorting,+ columnVisibility,+ pagination: {+ pageIndex,+ pageSize,+ },+ },+ });++ return (+ <div className="w-full">+ <div className="flex items-center justify-between py-4">+ <div className="flex items-center space-x-4">+ <Input+ placeholder="filter by text content..."+ value={textFilter}+ onChange={(event) => {+ setTextFilter(event.target.value);+ setPageIndex(0);+ }}+ className="max-w-sm"+ />+ <SqlAutocompleteInput+ id="appFilter"+ type="app"+ icon={<AppWindow className="h-4 w-4" />}+ value={appFilter}+ onChange={(value) => {+ setAppFilter(value);+ setPageIndex(0);+ }}+ placeholder="filter by app..."+ className="w-[300px]"+ />+ <Button+ variant="outline"+ size="icon"+ onClick={fetchData}+ disabled={isLoading}+ >+ <RefreshCw+ className={`h-4 w-4 ${isLoading ? "animate-spin" : ""}`}+ />+ </Button>+ </div>+ <DropdownMenu>+ <DropdownMenuTrigger asChild>+ <Button variant="outline">+ columns <ChevronDown className="ml-2 h-4 w-4" />+ </Button>+ </DropdownMenuTrigger>+ <DropdownMenuContent align="end">+ {table+ .getAllColumns()+ .filter((column) => column.getCanHide())+ .map((column) => {+ return (+ <DropdownMenuCheckboxItem+ key={column.id}+ className="capitalize"+ checked={column.getIsVisible()}+ onCheckedChange={(value) =>+ column.toggleVisibility(!!value)+ }+ >+ {column.id}+ </DropdownMenuCheckboxItem>+ );+ })}+ </DropdownMenuContent>+ </DropdownMenu>+ </div>+ {error ? (+ <div className="text-center text-red-500 py-4">{error}</div>+ ) : (+ <div className="rounded-md border">+ <Table>+ <TableHeader>+ {table.getHeaderGroups().map((headerGroup) => (+ <TableRow key={headerGroup.id}>+ {headerGroup.headers.map((header) => {+ return (+ <TableHead key={header.id}>+ {header.isPlaceholder+ ? null+ : flexRender(+ header.column.columnDef.header,+ header.getContext()+ )}+ </TableHead>+ );+ })}+ </TableRow>+ ))}+ </TableHeader>+ <TableBody>+ {isLoading ? (+ <TableRow>+ <TableCell+ colSpan={columns.length}+ className="h-24 text-center"+ >+ loading...+ </TableCell>+ </TableRow>+ ) : table.getRowModel().rows?.length ? (+ table.getRowModel().rows.map((row) => (+ <TableRow+ key={row.id}+ data-state={row.getIsSelected() && "selected"}+ >+ {row.getVisibleCells().map((cell) => (+ <TableCell key={cell.id}>+ {flexRender(+ cell.column.columnDef.cell,+ cell.getContext()+ )}+ </TableCell>+ ))}+ </TableRow>+ ))+ ) : (+ <TableRow>+ <TableCell+ colSpan={columns.length}+ className="h-24 text-center"+ >+ no results.+ </TableCell>+ </TableRow>+ )}+ </TableBody>+ </Table>+ </div>+ )}+ <div className="flex items-center justify-end space-x-2 py-4">+ <Button+ variant="outline"+ size="sm"+ onClick={() => table.previousPage()}+ disabled={!table.getCanPreviousPage()}+ >+ previous+ </Button>+ <Button+ variant="outline"+ size="sm"+ onClick={() => table.nextPage()}+ disabled={!table.getCanNextPage()}+ >+ next+ </Button>+ </div>+ </div>+ );+}diff --git a/pipes/data-table/src/components/ui/accordion.tsx b/pipes/data-table/src/components/ui/accordion.tsxnew file mode 100644index 000000000..24c788c2c--- /dev/null+++ b/pipes/data-table/src/components/ui/accordion.tsx@@ -0,0 +1,58 @@+"use client"++import * as React from "react"+import * as AccordionPrimitive from "@radix-ui/react-accordion"+import { ChevronDown } from "lucide-react"++import { cn } from "@/lib/utils"++const Accordion = AccordionPrimitive.Root++const AccordionItem = React.forwardRef<+ React.ElementRef<typeof AccordionPrimitive.Item>,+ React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Item>+>(({ className, ...props }, ref) => (+ <AccordionPrimitive.Item+ ref={ref}+ className={cn("border-b", className)}+ {...props}+ />+))+AccordionItem.displayName = "AccordionItem"++const AccordionTrigger = React.forwardRef<+ React.ElementRef<typeof AccordionPrimitive.Trigger>,+ React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Trigger>+>(({ className, children, ...props }, ref) => (+ <AccordionPrimitive.Header className="flex">+ <AccordionPrimitive.Trigger+ ref={ref}+ className={cn(+ "flex flex-1 items-center justify-between py-4 font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180",+ className+ )}+ {...props}+ >+ {children}+ <ChevronDown className="h-4 w-4 shrink-0 transition-transform duration-200" />+ </AccordionPrimitive.Trigger>+ </AccordionPrimitive.Header>+))+AccordionTrigger.displayName = AccordionPrimitive.Trigger.displayName++const AccordionContent = React.forwardRef<+ React.ElementRef<typeof AccordionPrimitive.Content>,+ React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Content>+>(({ className, children, ...props }, ref) => (+ <AccordionPrimitive.Content+ ref={ref}+ className="overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down"+ {...props}+ >+ <div className={cn("pb-4 pt-0", className)}>{children}</div>+ </AccordionPrimitive.Content>+))++AccordionContent.displayName = AccordionPrimitive.Content.displayName++export { Accordion, AccordionItem, AccordionTrigger, AccordionContent }diff --git a/pipes/data-table/src/components/ui/badge.tsx b/pipes/data-table/src/components/ui/badge.tsxnew file mode 100644index 000000000..f000e3ef5--- /dev/null+++ b/pipes/data-table/src/components/ui/badge.tsx@@ -0,0 +1,36 @@+import * as React from "react"+import { cva, type VariantProps } from "class-variance-authority"++import { cn } from "@/lib/utils"++const badgeVariants = cva(+ "inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",+ {+ variants: {+ variant: {+ default:+ "border-transparent bg-primary text-primary-foreground hover:bg-primary/80",+ secondary:+ "border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",+ destructive:+ "border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",+ outline: "text-foreground",+ },+ },+ defaultVariants: {+ variant: "default",+ },+ }+)++export interface BadgeProps+ extends React.HTMLAttributes<HTMLDivElement>,+ VariantProps<typeof badgeVariants> {}++function Badge({ className, variant, ...props }: BadgeProps) {+ return (+ <div className={cn(badgeVariants({ variant }), className)} {...props} />+ )+}++export { Badge, badgeVariants }diff --git a/pipes/data-table/src/components/ui/button.tsx b/pipes/data-table/src/components/ui/button.tsxnew file mode 100644index 000000000..36496a287--- /dev/null+++ b/pipes/data-table/src/components/ui/button.tsx@@ -0,0 +1,56 @@+import * as React from "react"+import { Slot } from "@radix-ui/react-slot"+import { cva, type VariantProps } from "class-variance-authority"++import { cn } from "@/lib/utils"++const buttonVariants = cva(+ "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",+ {+ variants: {+ variant: {+ default: "bg-primary text-primary-foreground hover:bg-primary/90",+ destructive:+ "bg-destructive text-destructive-foreground hover:bg-destructive/90",+ outline:+ "border border-input bg-background hover:bg-accent hover:text-accent-foreground",+ secondary:+ "bg-secondary text-secondary-foreground hover:bg-secondary/80",+ ghost: "hover:bg-accent hover:text-accent-foreground",+ link: "text-primary underline-offset-4 hover:underline",+ },+ size: {+ default: "h-10 px-4 py-2",+ sm: "h-9 rounded-md px-3",+ lg: "h-11 rounded-md px-8",+ icon: "h-10 w-10",+ },+ },+ defaultVariants: {+ variant: "default",+ size: "default",+ },+ }+)++export interface ButtonProps+ extends React.ButtonHTMLAttributes<HTMLButtonElement>,+ VariantProps<typeof buttonVariants> {+ asChild?: boolean+}++const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(+ ({ className, variant, size, asChild = false, ...props }, ref) => {+ const Comp = asChild ? Slot : "button"+ return (+ <Comp+ className={cn(buttonVariants({ variant, size, className }))}+ ref={ref}+ {...props}+ />+ )+ }+)+Button.displayName = "Button"++export { Button, buttonVariants }diff --git a/pipes/data-table/src/components/ui/calendar.tsx b/pipes/data-table/src/components/ui/calendar.tsxnew file mode 100644index 000000000..61d2b451e--- /dev/null+++ b/pipes/data-table/src/components/ui/calendar.tsx@@ -0,0 +1,66 @@+"use client"++import * as React from "react"+import { ChevronLeft, ChevronRight } from "lucide-react"+import { DayPicker } from "react-day-picker"++import { cn } from "@/lib/utils"+import { buttonVariants } from "@/components/ui/button"++export type CalendarProps = React.ComponentProps<typeof DayPicker>++function Calendar({+ className,+ classNames,+ showOutsideDays = true,+ ...props+}: CalendarProps) {+ return (+ <DayPicker+ showOutsideDays={showOutsideDays}+ className={cn("p-3", className)}+ classNames={{+ months: "flex flex-col sm:flex-row space-y-4 sm:space-x-4 sm:space-y-0",+ month: "space-y-4",+ caption: "flex justify-center pt-1 relative items-center",+ caption_label: "text-sm font-medium",+ nav: "space-x-1 flex items-center",+ nav_button: cn(+ buttonVariants({ variant: "outline" }),+ "h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100"+ ),+ nav_button_previous: "absolute left-1",+ nav_button_next: "absolute right-1",+ table: "w-full border-collapse space-y-1",+ head_row: "flex",+ head_cell:+ "text-muted-foreground rounded-md w-9 font-normal text-[0.8rem]",+ row: "flex w-full mt-2",+ cell: "h-9 w-9 text-center text-sm p-0 relative [&:has([aria-selected].day-range-end)]:rounded-r-md [&:has([aria-selected].day-outside)]:bg-accent/50 [&:has([aria-selected])]:bg-accent first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md focus-within:relative focus-within:z-20",+ day: cn(+ buttonVariants({ variant: "ghost" }),+ "h-9 w-9 p-0 font-normal aria-selected:opacity-100"+ ),+ day_range_end: "day-range-end",+ day_selected:+ "bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground",+ day_today: "bg-accent text-accent-foreground",+ day_outside:+ "day-outside text-muted-foreground aria-selected:bg-accent/50 aria-selected:text-muted-foreground",+ day_disabled: "text-muted-foreground opacity-50",+ day_range_middle:+ "aria-selected:bg-accent aria-selected:text-accent-foreground",+ day_hidden: "invisible",+ ...classNames,+ }}+ components={{+ IconLeft: ({ ...props }) => <ChevronLeft className="h-4 w-4" />,+ IconRight: ({ ...props }) => <ChevronRight className="h-4 w-4" />,+ }}+ {...props}+ />+ )+}+Calendar.displayName = "Calendar"++export { Calendar }diff --git a/pipes/data-table/src/components/ui/card.tsx b/pipes/data-table/src/components/ui/card.tsxnew file mode 100644index 000000000..f62edea57--- /dev/null+++ b/pipes/data-table/src/components/ui/card.tsx@@ -0,0 +1,79 @@+import * as React from "react"++import { cn } from "@/lib/utils"++const Card = React.forwardRef<+ HTMLDivElement,+ React.HTMLAttributes<HTMLDivElement>+>(({ className, ...props }, ref) => (+ <div+ ref={ref}+ className={cn(+ "rounded-lg border bg-card text-card-foreground shadow-sm",+ className+ )}+ {...props}+ />+))+Card.displayName = "Card"++const CardHeader = React.forwardRef<+ HTMLDivElement,+ React.HTMLAttributes<HTMLDivElement>+>(({ className, ...props }, ref) => (+ <div+ ref={ref}+ className={cn("flex flex-col space-y-1.5 p-6", className)}+ {...props}+ />+))+CardHeader.displayName = "CardHeader"++const CardTitle = React.forwardRef<+ HTMLDivElement,+ React.HTMLAttributes<HTMLDivElement>+>(({ className, ...props }, ref) => (+ <div+ ref={ref}+ className={cn(+ "text-2xl font-semibold leading-none tracking-tight",+ className+ )}+ {...props}+ />+))+CardTitle.displayName = "CardTitle"++const CardDescription = React.forwardRef<+ HTMLDivElement,+ React.HTMLAttributes<HTMLDivElement>+>(({ className, ...props }, ref) => (+ <div+ ref={ref}+ className={cn("text-sm text-muted-foreground", className)}+ {...props}+ />+))+CardDescription.displayName = "CardDescription"++const CardContent = React.forwardRef<+ HTMLDivElement,+ React.HTMLAttributes<HTMLDivElement>+>(({ className, ...props }, ref) => (+ <div ref={ref} className={cn("p-6 pt-0", className)} {...props} />+))+CardContent.displayName = "CardContent"++const CardFooter = React.forwardRef<+ HTMLDivElement,+ React.HTMLAttributes<HTMLDivElement>+>(({ className, ...props }, ref) => (+ <div+ ref={ref}+ className={cn("flex items-center p-6 pt-0", className)}+ {...props}+ />+))+CardFooter.displayName = "CardFooter"++export { Card, CardHeader, CardFooter, CardTitle, CardDescription, CardContent }diff --git a/pipes/data-table/src/components/ui/checkbox.tsx b/pipes/data-table/src/components/ui/checkbox.tsxnew file mode 100644index 000000000..df61a1388--- /dev/null+++ b/pipes/data-table/src/components/ui/checkbox.tsx@@ -0,0 +1,30 @@+"use client"++import * as React from "react"+import * as CheckboxPrimitive from "@radix-ui/react-checkbox"+import { Check } from "lucide-react"++import { cn } from "@/lib/utils"++const Checkbox = React.forwardRef<+ React.ElementRef<typeof CheckboxPrimitive.Root>,+ React.ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root>+>(({ className, ...props }, ref) => (+ <CheckboxPrimitive.Root+ ref={ref}+ className={cn(+ "peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",+ className+ )}+ {...props}+ >+ <CheckboxPrimitive.Indicator+ className={cn("flex items-center justify-center text-current")}+ >+ <Check className="h-4 w-4" />+ </CheckboxPrimitive.Indicator>+ </CheckboxPrimitive.Root>+))+Checkbox.displayName = CheckboxPrimitive.Root.displayName++export { Checkbox }diff --git a/pipes/data-table/src/components/ui/codeblock.tsx b/pipes/data-table/src/components/ui/codeblock.tsxnew file mode 100644index 000000000..e52893032--- /dev/null+++ b/pipes/data-table/src/components/ui/codeblock.tsx@@ -0,0 +1,148 @@+// Inspired by Chatbot-UI and modified to fit the needs of this project+// @see https://github.com/mckaywrigley/chatbot-ui/blob/main/components/Markdown/CodeBlock.tsx++"use client";++import { FC, memo } from "react";+import { Prism as SyntaxHighlighter } from "react-syntax-highlighter";+import { coldarkDark } from "react-syntax-highlighter/dist/cjs/styles/prism";++import { useCopyToClipboard } from "@/lib/hooks/use-copy-to-clipboard";+import { IconCheck, IconCopy, IconDownload } from "@/components/ui/icons";+import { Button } from "@/components/ui/button";++interface Props {+ language: string;+ value: string;+}++interface languageMap {+ [key: string]: string | undefined;+}++export const programmingLanguages: languageMap = {+ javascript: ".js",+ python: ".py",+ java: ".java",+ c: ".c",+ cpp: ".cpp",+ "c++": ".cpp",+ "c#": ".cs",+ ruby: ".rb",+ php: ".php",+ swift: ".swift",+ "objective-c": ".m",+ kotlin: ".kt",+ typescript: ".ts",+ go: ".go",+ perl: ".pl",+ rust: ".rs",+ scala: ".scala",+ haskell: ".hs",+ lua: ".lua",+ shell: ".sh",+ sql: ".sql",+ html: ".html",+ css: ".css",+ // add more file extensions here, make sure the key is same as language prop in CodeBlock.tsx component+};++export const generateRandomString = (length: number, lowercase = false) => {+ const chars = "ABCDEFGHJKLMNPQRSTUVWXY3456789"; // excluding similar looking characters like Z, 2, I, 1, O, 0+ let result = "";+ for (let i = 0; i < length; i++) {+ result += chars.charAt(Math.floor(Math.random() * chars.length));+ }+ return lowercase ? result.toLowerCase() : result;+};++const CodeBlock: FC<Props> = memo(({ language, value }) => {+ const { isCopied, copyToClipboard } = useCopyToClipboard({ timeout: 2000 });++ const downloadAsFile = () => {+ if (typeof window === "undefined") {+ return;+ }+ const fileExtension = programmingLanguages[language] || ".file";+ const suggestedFileName = `file-${generateRandomString(+ 3,+ true+ )}${fileExtension}`;+ const fileName = window.prompt("Enter file name", suggestedFileName);++ if (!fileName) {+ // User pressed cancel on prompt.+ return;+ }++ const blob = new Blob([value], { type: "text/plain" });+ const url = URL.createObjectURL(blob);+ const link = document.createElement("a");+ link.download = fileName;+ link.href = url;+ link.style.display = "none";+ document.body.appendChild(link);+ link.click();+ document.body.removeChild(link);+ URL.revokeObjectURL(url);+ };++ const onCopy = () => {+ if (isCopied) return;+ copyToClipboard(value);+ };++ return (+ <div className="relative w-full font-sans codeblock bg-zinc-950">+ <div className="flex items-center justify-between w-full px-6 py-2 pr-4 bg-zinc-800 text-zinc-100">+ <span className="text-xs lowercase">{language}</span>+ <div className="flex items-center space-x-1">+ <Button+ variant="ghost"+ className="hover:bg-zinc-800 focus-visible:ring-1 focus-visible:ring-slate-700 focus-visible:ring-offset-0"+ onClick={downloadAsFile}+ size="icon"+ >+ <IconDownload />+ <span className="sr-only">Download</span>+ </Button>+ <Button+ variant="ghost"+ size="icon"+ className="text-xs hover:bg-zinc-800 focus-visible:ring-1 focus-visible:ring-slate-700 focus-visible:ring-offset-0"+ onClick={onCopy}+ >+ {isCopied ? <IconCheck /> : <IconCopy />}+ <span className="sr-only">Copy code</span>+ </Button>+ </div>+ </div>+ <SyntaxHighlighter+ language={language}+ style={coldarkDark}+ PreTag="div"+ showLineNumbers+ customStyle={{+ margin: 0,+ width: "100%",+ background: "transparent",+ padding: "1.5rem 1rem",+ }}+ lineNumberStyle={{+ userSelect: "none",+ }}+ codeTagProps={{+ style: {+ fontSize: "0.9rem",+ fontFamily: "var(--font-mono)",+ },+ }}+ >+ {value}+ </SyntaxHighlighter>+ </div>+ );+});+CodeBlock.displayName = "CodeBlock";++export { CodeBlock };diff --git a/pipes/data-table/src/components/ui/command.tsx b/pipes/data-table/src/components/ui/command.tsxnew file mode 100644index 000000000..59a264529--- /dev/null+++ b/pipes/data-table/src/components/ui/command.tsx@@ -0,0 +1,153 @@+"use client"++import * as React from "react"+import { type DialogProps } from "@radix-ui/react-dialog"+import { Command as CommandPrimitive } from "cmdk"+import { Search } from "lucide-react"++import { cn } from "@/lib/utils"+import { Dialog, DialogContent } from "@/components/ui/dialog"++const Command = React.forwardRef<+ React.ElementRef<typeof CommandPrimitive>,+ React.ComponentPropsWithoutRef<typeof CommandPrimitive>+>(({ className, ...props }, ref) => (+ <CommandPrimitive+ ref={ref}+ className={cn(+ "flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",+ className+ )}+ {...props}+ />+))+Command.displayName = CommandPrimitive.displayName++const CommandDialog = ({ children, ...props }: DialogProps) => {+ return (+ <Dialog {...props}>+ <DialogContent className="overflow-hidden p-0 shadow-lg">+ <Command className="[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-group]]:px-2 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5">+ {children}+ </Command>+ </DialogContent>+ </Dialog>+ )+}++const CommandInput = React.forwardRef<+ React.ElementRef<typeof CommandPrimitive.Input>,+ React.ComponentPropsWithoutRef<typeof CommandPrimitive.Input>+>(({ className, ...props }, ref) => (+ <div className="flex items-center border-b px-3" cmdk-input-wrapper="">+ <Search className="mr-2 h-4 w-4 shrink-0 opacity-50" />+ <CommandPrimitive.Input+ ref={ref}+ className={cn(+ "flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",+ className+ )}+ {...props}+ />+ </div>+))++CommandInput.displayName = CommandPrimitive.Input.displayName++const CommandList = React.forwardRef<+ React.ElementRef<typeof CommandPrimitive.List>,+ React.ComponentPropsWithoutRef<typeof CommandPrimitive.List>+>(({ className, ...props }, ref) => (+ <CommandPrimitive.List+ ref={ref}+ className={cn("max-h-[300px] overflow-y-auto overflow-x-hidden", className)}+ {...props}+ />+))++CommandList.displayName = CommandPrimitive.List.displayName++const CommandEmpty = React.forwardRef<+ React.ElementRef<typeof CommandPrimitive.Empty>,+ React.ComponentPropsWithoutRef<typeof CommandPrimitive.Empty>+>((props, ref) => (+ <CommandPrimitive.Empty+ ref={ref}+ className="py-6 text-center text-sm"+ {...props}+ />+))++CommandEmpty.displayName = CommandPrimitive.Empty.displayName++const CommandGroup = React.forwardRef<+ React.ElementRef<typeof CommandPrimitive.Group>,+ React.ComponentPropsWithoutRef<typeof CommandPrimitive.Group>+>(({ className, ...props }, ref) => (+ <CommandPrimitive.Group+ ref={ref}+ className={cn(+ "overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",+ className+ )}+ {...props}+ />+))++CommandGroup.displayName = CommandPrimitive.Group.displayName++const CommandSeparator = React.forwardRef<+ React.ElementRef<typeof CommandPrimitive.Separator>,+ React.ComponentPropsWithoutRef<typeof CommandPrimitive.Separator>+>(({ className, ...props }, ref) => (+ <CommandPrimitive.Separator+ ref={ref}+ className={cn("-mx-1 h-px bg-border", className)}+ {...props}+ />+))+CommandSeparator.displayName = CommandPrimitive.Separator.displayName++const CommandItem = React.forwardRef<+ React.ElementRef<typeof CommandPrimitive.Item>,+ React.ComponentPropsWithoutRef<typeof CommandPrimitive.Item>+>(({ className, ...props }, ref) => (+ <CommandPrimitive.Item+ ref={ref}+ className={cn(+ "relative flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected='true']:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",+ className+ )}+ {...props}+ />+))++CommandItem.displayName = CommandPrimitive.Item.displayName++const CommandShortcut = ({+ className,+ ...props+}: React.HTMLAttributes<HTMLSpanElement>) => {+ return (+ <span+ className={cn(+ "ml-auto text-xs tracking-widest text-muted-foreground",+ className+ )}+ {...props}+ />+ )+}+CommandShortcut.displayName = "CommandShortcut"++export {+ Command,+ CommandDialog,+ CommandInput,+ CommandList,+ CommandEmpty,+ CommandGroup,+ CommandItem,+ CommandShortcut,+ CommandSeparator,+}diff --git a/pipes/data-table/src/components/ui/dialog.tsx b/pipes/data-table/src/components/ui/dialog.tsxnew file mode 100644index 000000000..01ff19c7e--- /dev/null+++ b/pipes/data-table/src/components/ui/dialog.tsx@@ -0,0 +1,122 @@+"use client"++import * as React from "react"+import * as DialogPrimitive from "@radix-ui/react-dialog"+import { X } from "lucide-react"++import { cn } from "@/lib/utils"++const Dialog = DialogPrimitive.Root++const DialogTrigger = DialogPrimitive.Trigger++const DialogPortal = DialogPrimitive.Portal++const DialogClose = DialogPrimitive.Close++const DialogOverlay = React.forwardRef<+ React.ElementRef<typeof DialogPrimitive.Overlay>,+ React.ComponentPropsWithoutRef<typeof DialogPrimitive.Overlay>+>(({ className, ...props }, ref) => (+ <DialogPrimitive.Overlay+ ref={ref}+ className={cn(+ "fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",+ className+ )}+ {...props}+ />+))+DialogOverlay.displayName = DialogPrimitive.Overlay.displayName++const DialogContent = React.forwardRef<+ React.ElementRef<typeof DialogPrimitive.Content>,+ React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content>+>(({ className, children, ...props }, ref) => (+ <DialogPortal>+ <DialogOverlay />+ <DialogPrimitive.Content+ ref={ref}+ className={cn(+ "fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",+ className+ )}+ {...props}+ >+ {children}+ <DialogPrimitive.Close className="absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground">+ <X className="h-4 w-4" />+ <span className="sr-only">Close</span>+ </DialogPrimitive.Close>+ </DialogPrimitive.Content>+ </DialogPortal>+))+DialogContent.displayName = DialogPrimitive.Content.displayName++const DialogHeader = ({+ className,+ ...props+}: React.HTMLAttributes<HTMLDivElement>) => (+ <div+ className={cn(+ "flex flex-col space-y-1.5 text-center sm:text-left",+ className+ )}+ {...props}+ />+)+DialogHeader.displayName = "DialogHeader"++const DialogFooter = ({+ className,+ ...props+}: React.HTMLAttributes<HTMLDivElement>) => (+ <div+ className={cn(+ "flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",+ className+ )}+ {...props}+ />+)+DialogFooter.displayName = "DialogFooter"++const DialogTitle = React.forwardRef<+ React.ElementRef<typeof DialogPrimitive.Title>,+ React.ComponentPropsWithoutRef<typeof DialogPrimitive.Title>+>(({ className, ...props }, ref) => (+ <DialogPrimitive.Title+ ref={ref}+ className={cn(+ "text-lg font-semibold leading-none tracking-tight",+ className+ )}+ {...props}+ />+))+DialogTitle.displayName = DialogPrimitive.Title.displayName++const DialogDescription = React.forwardRef<+ React.ElementRef<typeof DialogPrimitive.Description>,+ React.ComponentPropsWithoutRef<typeof DialogPrimitive.Description>+>(({ className, ...props }, ref) => (+ <DialogPrimitive.Description+ ref={ref}+ className={cn("text-sm text-muted-foreground", className)}+ {...props}+ />+))+DialogDescription.displayName = DialogPrimitive.Description.displayName++export {+ Dialog,+ DialogPortal,+ DialogOverlay,+ DialogClose,+ DialogTrigger,+ DialogContent,+ DialogHeader,+ DialogFooter,+ DialogTitle,+ DialogDescription,+}diff --git a/pipes/data-table/src/components/ui/dropdown-menu.tsx b/pipes/data-table/src/components/ui/dropdown-menu.tsxnew file mode 100644index 000000000..0fc4c0e07--- /dev/null+++ b/pipes/data-table/src/components/ui/dropdown-menu.tsx@@ -0,0 +1,200 @@+"use client"++import * as React from "react"+import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu"+import { Check, ChevronRight, Circle } from "lucide-react"++import { cn } from "@/lib/utils"++const DropdownMenu = DropdownMenuPrimitive.Root++const DropdownMenuTrigger = DropdownMenuPrimitive.Trigger++const DropdownMenuGroup = DropdownMenuPrimitive.Group++const DropdownMenuPortal = DropdownMenuPrimitive.Portal++const DropdownMenuSub = DropdownMenuPrimitive.Sub++const DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup++const DropdownMenuSubTrigger = React.forwardRef<+ React.ElementRef<typeof DropdownMenuPrimitive.SubTrigger>,+ React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubTrigger> & {+ inset?: boolean+ }+>(({ className, inset, children, ...props }, ref) => (+ <DropdownMenuPrimitive.SubTrigger+ ref={ref}+ className={cn(+ "flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",+ inset && "pl-8",+ className+ )}+ {...props}+ >+ {children}+ <ChevronRight className="ml-auto" />+ </DropdownMenuPrimitive.SubTrigger>+))+DropdownMenuSubTrigger.displayName =+ DropdownMenuPrimitive.SubTrigger.displayName++const DropdownMenuSubContent = React.forwardRef<+ React.ElementRef<typeof DropdownMenuPrimitive.SubContent>,+ React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubContent>+>(({ className, ...props }, ref) => (+ <DropdownMenuPrimitive.SubContent+ ref={ref}+ className={cn(+ "z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",+ className+ )}+ {...props}+ />+))+DropdownMenuSubContent.displayName =+ DropdownMenuPrimitive.SubContent.displayName++const DropdownMenuContent = React.forwardRef<+ React.ElementRef<typeof DropdownMenuPrimitive.Content>,+ React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Content>+>(({ className, sideOffset = 4, ...props }, ref) => (+ <DropdownMenuPrimitive.Portal>+ <DropdownMenuPrimitive.Content+ ref={ref}+ sideOffset={sideOffset}+ className={cn(+ "z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",+ className+ )}+ {...props}+ />+ </DropdownMenuPrimitive.Portal>+))+DropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName++const DropdownMenuItem = React.forwardRef<+ React.ElementRef<typeof DropdownMenuPrimitive.Item>,+ React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Item> & {+ inset?: boolean+ }+>(({ className, inset, ...props }, ref) => (+ <DropdownMenuPrimitive.Item+ ref={ref}+ className={cn(+ "relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",+ inset && "pl-8",+ className+ )}+ {...props}+ />+))+DropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName++const DropdownMenuCheckboxItem = React.forwardRef<+ React.ElementRef<typeof DropdownMenuPrimitive.CheckboxItem>,+ React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.CheckboxItem>+>(({ className, children, checked, ...props }, ref) => (+ <DropdownMenuPrimitive.CheckboxItem+ ref={ref}+ className={cn(+ "relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",+ className+ )}+ checked={checked}+ {...props}+ >+ <span className="absolute left-2 flex h-3.5 w-3.5 items-center justify-center">+ <DropdownMenuPrimitive.ItemIndicator>+ <Check className="h-4 w-4" />+ </DropdownMenuPrimitive.ItemIndicator>+ </span>+ {children}+ </DropdownMenuPrimitive.CheckboxItem>+))+DropdownMenuCheckboxItem.displayName =+ DropdownMenuPrimitive.CheckboxItem.displayName++const DropdownMenuRadioItem = React.forwardRef<+ React.ElementRef<typeof DropdownMenuPrimitive.RadioItem>,+ React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.RadioItem>+>(({ className, children, ...props }, ref) => (+ <DropdownMenuPrimitive.RadioItem+ ref={ref}+ className={cn(+ "relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",+ className+ )}+ {...props}+ >+ <span className="absolute left-2 flex h-3.5 w-3.5 items-center justify-center">+ <DropdownMenuPrimitive.ItemIndicator>+ <Circle className="h-2 w-2 fill-current" />+ </DropdownMenuPrimitive.ItemIndicator>+ </span>+ {children}+ </DropdownMenuPrimitive.RadioItem>+))+DropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName++const DropdownMenuLabel = React.forwardRef<+ React.ElementRef<typeof DropdownMenuPrimitive.Label>,+ React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Label> & {+ inset?: boolean+ }+>(({ className, inset, ...props }, ref) => (+ <DropdownMenuPrimitive.Label+ ref={ref}+ className={cn(+ "px-2 py-1.5 text-sm font-semibold",+ inset && "pl-8",+ className+ )}+ {...props}+ />+))+DropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName++const DropdownMenuSeparator = React.forwardRef<+ React.ElementRef<typeof DropdownMenuPrimitive.Separator>,+ React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Separator>+>(({ className, ...props }, ref) => (+ <DropdownMenuPrimitive.Separator+ ref={ref}+ className={cn("-mx-1 my-1 h-px bg-muted", className)}+ {...props}+ />+))+DropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName++const DropdownMenuShortcut = ({+ className,+ ...props+}: React.HTMLAttributes<HTMLSpanElement>) => {+ return (+ <span+ className={cn("ml-auto text-xs tracking-widest opacity-60", className)}+ {...props}+ />+ )+}+DropdownMenuShortcut.displayName = "DropdownMenuShortcut"++export {+ DropdownMenu,+ DropdownMenuTrigger,+ DropdownMenuContent,+ DropdownMenuItem,+ DropdownMenuCheckboxItem,+ DropdownMenuRadioItem,+ DropdownMenuLabel,+ DropdownMenuSeparator,+ DropdownMenuShortcut,+ DropdownMenuGroup,+ DropdownMenuPortal,+ DropdownMenuSub,+ DropdownMenuSubContent,+ DropdownMenuSubTrigger,+ DropdownMenuRadioGroup,+}diff --git a/pipes/data-table/src/components/ui/icons.tsx b/pipes/data-table/src/components/ui/icons.tsxnew file mode 100644index 000000000..492377647--- /dev/null+++ b/pipes/data-table/src/components/ui/icons.tsx@@ -0,0 +1,593 @@+"use client";++import * as React from "react";++import { cn } from "@/lib/utils";++function IconNextChat({+ className,+ inverted,+ ...props+}: React.ComponentProps<"svg"> & { inverted?: boolean }) {+ const id = React.useId();++ return (+ <svg+ viewBox="0 0 17 17"+ fill="none"+ xmlns="http://www.w3.org/2000/svg"+ className={cn("size-4", className)}+ {...props}+ >+ <defs>+ <linearGradient+ id={`gradient-${id}-1`}+ x1="10.6889"+ y1="10.3556"+ x2="13.8445"+ y2="14.2667"+ gradientUnits="userSpaceOnUse"+ >+ <stop stopColor={inverted ? "white" : "black"} />+ <stop+ offset={1}+ stopColor={inverted ? "white" : "black"}+ stopOpacity={0}+ />+ </linearGradient>+ <linearGradient+ id={`gradient-${id}-2`}+ x1="11.7555"+ y1="4.8"+ x2="11.7376"+ y2="9.50002"+ gradientUnits="userSpaceOnUse"+ >+ <stop stopColor={inverted ? "white" : "black"} />+ <stop+ offset={1}+ stopColor={inverted ? "white" : "black"}+ stopOpacity={0}+ />+ </linearGradient>+ </defs>+ <path+ d="M1 16L2.58314 11.2506C1.83084 9.74642 1.63835 8.02363 2.04013 6.39052C2.4419 4.75741 3.41171 3.32057 4.776 2.33712C6.1403 1.35367 7.81003 0.887808 9.4864 1.02289C11.1628 1.15798 12.7364 1.8852 13.9256 3.07442C15.1148 4.26363 15.842 5.83723 15.9771 7.5136C16.1122 9.18997 15.6463 10.8597 14.6629 12.224C13.6794 13.5883 12.2426 14.5581 10.6095 14.9599C8.97637 15.3616 7.25358 15.1692 5.74942 14.4169L1 16Z"+ fill={inverted ? "black" : "white"}+ stroke={inverted ? "black" : "white"}+ strokeWidth={2}+ strokeLinecap="round"+ strokeLinejoin="round"+ />+ <mask+ id="mask0_91_2047"+ style={{ maskType: "alpha" }}+ maskUnits="userSpaceOnUse"+ x={1}+ y={0}+ width={16}+ height={16}+ >+ <circle cx={9} cy={8} r={8} fill={inverted ? "black" : "white"} />+ </mask>+ <g mask="url(#mask0_91_2047)">+ <circle cx={9} cy={8} r={8} fill={inverted ? "black" : "white"} />+ <path+ d="M14.2896 14.0018L7.146 4.8H5.80005V11.1973H6.87681V6.16743L13.4444 14.6529C13.7407 14.4545 14.0231 14.2369 14.2896 14.0018Z"+ fill={`url(#gradient-${id}-1)`}+ />+ <rect+ x="11.2222"+ y="4.8"+ width="1.06667"+ height="6.4"+ fill={`url(#gradient-${id}-2)`}+ />+ </g>+ </svg>+ );+}++function IconOpenAI({ className, ...props }: React.ComponentProps<"svg">) {+ return (+ <svg+ fill="currentColor"+ viewBox="0 0 24 24"+ role="img"+ xmlns="http://www.w3.org/2000/svg"+ className={cn("size-4", className)}+ {...props}+ >+ <title>OpenAI icon</title>+ <path d="M22.2819 9.8211a5.9847 5.9847 0 0 0-.5157-4.9108 6.0462 6.0462 0 0 0-6.5098-2.9A6.0651 6.0651 0 0 0 4.9807 4.1818a5.9847 5.9847 0 0 0-3.9977 2.9 6.0462 6.0462 0 0 0 .7427 7.0966 5.98 5.98 0 0 0 .511 4.9107 6.051 6.051 0 0 0 6.5146 2.9001A5.9847 5.9847 0 0 0 13.2599 24a6.0557 6.0557 0 0 0 5.7718-4.2058 5.9894 5.9894 0 0 0 3.9977-2.9001 6.0557 6.0557 0 0 0-.7475-7.0729zm-9.022 12.6081a4.4755 4.4755 0 0 1-2.8764-1.0408l.1419-.0804 4.7783-2.7582a.7948.7948 0 0 0 .3927-.6813v-6.7369l2.02 1.1686a.071.071 0 0 1 .038.052v5.5826a4.504 4.504 0 0 1-4.4945 4.4944zm-9.6607-4.1254a4.4708 4.4708 0 0 1-.5346-3.0137l.142.0852 4.783 2.7582a.7712.7712 0 0 0 .7806 0l5.8428-3.3685v2.3324a.0804.0804 0 0 1-.0332.0615L9.74 19.9502a4.4992 4.4992 0 0 1-6.1408-1.6464zM2.3408 7.8956a4.485 4.485 0 0 1 2.3655-1.9728V11.6a.7664.7664 0 0 0 .3879.6765l5.8144 3.3543-2.0201 1.1685a.0757.0757 0 0 1-.071 0l-4.8303-2.7865A4.504 4.504 0 0 1 2.3408 7.872zm16.5963 3.8558L13.1038 8.364 15.1192 7.2a.0757.0757 0 0 1 .071 0l4.8303 2.7913a4.4944 4.4944 0 0 1-.6765 8.1042v-5.6772a.79.79 0 0 0-.407-.667zm2.0107-3.0231l-.142-.0852-4.7735-2.7818a.7759.7759 0 0 0-.7854 0L9.409 9.2297V6.8974a.0662.0662 0 0 1 .0284-.0615l4.8303-2.7866a4.4992 4.4992 0 0 1 6.6802 4.66zM8.3065 12.863l-2.02-1.1638a.0804.0804 0 0 1-.038-.0567V6.0742a4.4992 4.4992 0 0 1 7.3757-3.4537l-.142.0805L8.704 5.459a.7948.7948 0 0 0-.3927.6813zm1.0976-2.3654l2.602-1.4998 2.6069 1.4998v2.9994l-2.5974 1.4997-2.6067-1.4997Z" />+ </svg>+ );+}++function IconVercel({ className, ...props }: React.ComponentProps<"svg">) {+ return (+ <svg+ aria-label="Vercel logomark"+ role="img"+ viewBox="0 0 74 64"+ className={cn("size-4", className)}+ {...props}+ >+ <path+ d="M37.5896 0.25L74.5396 64.25H0.639648L37.5896 0.25Z"+ fill="currentColor"+ ></path>+ </svg>+ );+}++function IconGitHub({ className, ...props }: React.ComponentProps<"svg">) {+ return (+ <svg+ role="img"+ viewBox="0 0 24 24"+ xmlns="http://www.w3.org/2000/svg"+ fill="currentColor"+ className={cn("size-4", className)}+ {...props}+ >+ <title>GitHub</title>+ <path d="M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12" />+ </svg>+ );+}++function IconSeparator({ className, ...props }: React.ComponentProps<"svg">) {+ return (+ <svg+ fill="none"+ shapeRendering="geometricPrecision"+ stroke="currentColor"+ strokeLinecap="round"+ strokeLinejoin="round"+ strokeWidth="1"+ viewBox="0 0 24 24"+ aria-hidden="true"+ className={cn("size-4", className)}+ {...props}+ >+ <path d="M16.88 3.549L7.12 20.451"></path>+ </svg>+ );+}++function IconArrowDown({ className, ...props }: React.ComponentProps<"svg">) {+ return (+ <svg+ xmlns="http://www.w3.org/2000/svg"+ viewBox="0 0 256 256"+ fill="currentColor"+ className={cn("size-4", className)}+ {...props}+ >+ <path d="m205.66 149.66-72 72a8 8 0 0 1-11.32 0l-72-72a8 8 0 0 1 11.32-11.32L120 196.69V40a8 8 0 0 1 16 0v156.69l58.34-58.35a8 8 0 0 1 11.32 11.32Z" />+ </svg>+ );+}++function IconArrowRight({ className, ...props }: React.ComponentProps<"svg">) {+ return (+ <svg+ xmlns="http://www.w3.org/2000/svg"+ viewBox="0 0 256 256"+ fill="currentColor"+ className={cn("size-4", className)}+ {...props}+ >+ <path d="m221.66 133.66-72 72a8 8 0 0 1-11.32-11.32L196.69 136H40a8 8 0 0 1 0-16h156.69l-58.35-58.34a8 8 0 0 1 11.32-11.32l72 72a8 8 0 0 1 0 11.32Z" />+ </svg>+ );+}++function IconUser({ className, ...props }: React.ComponentProps<"svg">) {+ return (+ <svg+ xmlns="http://www.w3.org/2000/svg"+ viewBox="0 0 256 256"+ fill="currentColor"+ className={cn("size-4", className)}+ {...props}+ >+ <path d="M230.92 212c-15.23-26.33-38.7-45.21-66.09-54.16a72 72 0 1 0-73.66 0c-27.39 8.94-50.86 27.82-66.09 54.16a8 8 0 1 0 13.85 8c18.84-32.56 52.14-52 89.07-52s70.23 19.44 89.07 52a8 8 0 1 0 13.85-8ZM72 96a56 56 0 1 1 56 56 56.06 56.06 0 0 1-56-56Z" />+ </svg>+ );+}++function IconPlus({ className, ...props }: React.ComponentProps<"svg">) {+ return (+ <svg+ xmlns="http://www.w3.org/2000/svg"+ viewBox="0 0 256 256"+ fill="currentColor"+ className={cn("size-4", className)}+ {...props}+ >+ <path d="M224 128a8 8 0 0 1-8 8h-80v80a8 8 0 0 1-16 0v-80H40a8 8 0 0 1 0-16h80V40a8 8 0 0 1 16 0v80h80a8 8 0 0 1 8 8Z" />+ </svg>+ );+}++function IconArrowElbow({ className, ...props }: React.ComponentProps<"svg">) {+ return (+ <svg+ xmlns="http://www.w3.org/2000/svg"+ viewBox="0 0 256 256"+ fill="currentColor"+ className={cn("size-4", className)}+ {...props}+ >+ <path d="M200 32v144a8 8 0 0 1-8 8H67.31l34.35 34.34a8 8 0 0 1-11.32 11.32l-48-48a8 8 0 0 1 0-11.32l48-48a8 8 0 0 1 11.32 11.32L67.31 168H184V32a8 8 0 0 1 16 0Z" />+ </svg>+ );+}++function IconSpinner({ className, ...props }: React.ComponentProps<"svg">) {+ return (+ <svg+ xmlns="http://www.w3.org/2000/svg"+ viewBox="0 0 256 256"+ fill="currentColor"+ className={cn("size-4 animate-spin", className)}+ {...props}+ >+ <path d="M232 128a104 104 0 0 1-208 0c0-41 23.81-78.36 60.66-95.27a8 8 0 0 1 6.68 14.54C60.15 61.59 40 93.27 40 128a88 88 0 0 0 176 0c0-34.73-20.15-66.41-51.34-80.73a8 8 0 0 1 6.68-14.54C208.19 49.64 232 87 232 128Z" />+ </svg>+ );+}++function IconMessage({ className, ...props }: React.ComponentProps<"svg">) {+ return (+ <svg+ xmlns="http://www.w3.org/2000/svg"+ viewBox="0 0 256 256"+ fill="currentColor"+ className={cn("size-4", className)}+ {...props}+ >+ <path d="M216 48H40a16 16 0 0 0-16 16v160a15.84 15.84 0 0 0 9.25 14.5A16.05 16.05 0 0 0 40 240a15.89 15.89 0 0 0 10.25-3.78.69.69 0 0 0 .13-.11L82.5 208H216a16 16 0 0 0 16-16V64a16 16 0 0 0-16-16ZM40 224Zm176-32H82.5a16 16 0 0 0-10.3 3.75l-.12.11L40 224V64h176Z" />+ </svg>+ );+}++function IconTrash({ className, ...props }: React.ComponentProps<"svg">) {+ return (+ <svg+ xmlns="http://www.w3.org/2000/svg"+ viewBox="0 0 256 256"+ fill="currentColor"+ className={cn("size-4", className)}+ {...props}+ >+ <path d="M216 48h-40v-8a24 24 0 0 0-24-24h-48a24 24 0 0 0-24 24v8H40a8 8 0 0 0 0 16h8v144a16 16 0 0 0 16 16h128a16 16 0 0 0 16-16V64h8a8 8 0 0 0 0-16ZM96 40a8 8 0 0 1 8-8h48a8 8 0 0 1 8 8v8H96Zm96 168H64V64h128Zm-80-104v64a8 8 0 0 1-16 0v-64a8 8 0 0 1 16 0Zm48 0v64a8 8 0 0 1-16 0v-64a8 8 0 0 1 16 0Z" />+ </svg>+ );+}++function IconRefresh({ className, ...props }: React.ComponentProps<"svg">) {+ return (+ <svg+ xmlns="http://www.w3.org/2000/svg"+ viewBox="0 0 256 256"+ fill="currentColor"+ className={cn("size-4", className)}+ {...props}+ >+ <path d="M197.67 186.37a8 8 0 0 1 0 11.29C196.58 198.73 170.82 224 128 224c-37.39 0-64.53-22.4-80-39.85V208a8 8 0 0 1-16 0v-48a8 8 0 0 1 8-8h48a8 8 0 0 1 0 16H55.44C67.76 183.35 93 208 128 208c36 0 58.14-21.46 58.36-21.68a8 8 0 0 1 11.31.05ZM216 40a8 8 0 0 0-8 8v23.85C192.53 54.4 165.39 32 128 32c-42.82 0-68.58 25.27-69.66 26.34a8 8 0 0 0 11.3 11.34C69.86 69.46 92 48 128 48c35 0 60.24 24.65 72.56 40H168a8 8 0 0 0 0 16h48a8 8 0 0 0 8-8V48a8 8 0 0 0-8-8Z" />+ </svg>+ );+}++function IconStop({ className, ...props }: React.ComponentProps<"svg">) {+ return (+ <svg+ xmlns="http://www.w3.org/2000/svg"+ viewBox="0 0 256 256"+ fill="currentColor"+ className={cn("size-4", className)}+ {...props}+ >+ <path d="M128 24a104 104 0 1 0 104 104A104.11 104.11 0 0 0 128 24Zm0 192a88 88 0 1 1 88-88 88.1 88.1 0 0 1-88 88Zm24-120h-48a8 8 0 0 0-8 8v48a8 8 0 0 0 8 8h48a8 8 0 0 0 8-8v-48a8 8 0 0 0-8-8Zm-8 48h-32v-32h32Z" />+ </svg>+ );+}++function IconSidebar({ className, ...props }: React.ComponentProps<"svg">) {+ return (+ <svg+ xmlns="http://www.w3.org/2000/svg"+ viewBox="0 0 256 256"+ fill="currentColor"+ className={cn("size-4", className)}+ {...props}+ >+ <path d="M216 40H40a16 16 0 0 0-16 16v144a16 16 0 0 0 16 16h176a16 16 0 0 0 16-16V56a16 16 0 0 0-16-16ZM40 56h40v144H40Zm176 144H96V56h120v144Z" />+ </svg>+ );+}++function IconMoon({ className, ...props }: React.ComponentProps<"svg">) {+ return (+ <svg+ xmlns="http://www.w3.org/2000/svg"+ viewBox="0 0 256 256"+ fill="currentColor"+ className={cn("size-4", className)}+ {...props}+ >+ <path d="M233.54 142.23a8 8 0 0 0-8-2 88.08 88.08 0 0 1-109.8-109.8 8 8 0 0 0-10-10 104.84 104.84 0 0 0-52.91 37A104 104 0 0 0 136 224a103.09 103.09 0 0 0 62.52-20.88 104.84 104.84 0 0 0 37-52.91 8 8 0 0 0-1.98-7.98Zm-44.64 48.11A88 88 0 0 1 65.66 67.11a89 89 0 0 1 31.4-26A106 106 0 0 0 96 56a104.11 104.11 0 0 0 104 104 106 106 0 0 0 14.92-1.06 89 89 0 0 1-26.02 31.4Z" />+ </svg>+ );+}++function IconSun({ className, ...props }: React.ComponentProps<"svg">) {+ return (+ <svg+ xmlns="http://www.w3.org/2000/svg"+ viewBox="0 0 256 256"+ fill="currentColor"+ className={cn("size-4", className)}+ {...props}+ >+ <path d="M120 40V16a8 8 0 0 1 16 0v24a8 8 0 0 1-16 0Zm72 88a64 64 0 1 1-64-64 64.07 64.07 0 0 1 64 64Zm-16 0a48 48 0 1 0-48 48 48.05 48.05 0 0 0 48-48ZM58.34 69.66a8 8 0 0 0 11.32-11.32l-16-16a8 8 0 0 0-11.32 11.32Zm0 116.68-16 16a8 8 0 0 0 11.32 11.32l16-16a8 8 0 0 0-11.32-11.32ZM192 72a8 8 0 0 0 5.66-2.34l16-16a8 8 0 0 0-11.32-11.32l-16 16A8 8 0 0 0 192 72Zm5.66 114.34a8 8 0 0 0-11.32 11.32l16 16a8 8 0 0 0 11.32-11.32ZM48 128a8 8 0 0 0-8-8H16a8 8 0 0 0 0 16h24a8 8 0 0 0 8-8Zm80 80a8 8 0 0 0-8 8v24a8 8 0 0 0 16 0v-24a8 8 0 0 0-8-8Zm112-88h-24a8 8 0 0 0 0 16h24a8 8 0 0 0 0-16Z" />+ </svg>+ );+}++function IconCopy({ className, ...props }: React.ComponentProps<"svg">) {+ return (+ <svg+ xmlns="http://www.w3.org/2000/svg"+ viewBox="0 0 256 256"+ fill="currentColor"+ className={cn("size-4", className)}+ {...props}+ >+ <path d="M216 32H88a8 8 0 0 0-8 8v40H40a8 8 0 0 0-8 8v128a8 8 0 0 0 8 8h128a8 8 0 0 0 8-8v-40h40a8 8 0 0 0 8-8V40a8 8 0 0 0-8-8Zm-56 176H48V96h112Zm48-48h-32V88a8 8 0 0 0-8-8H96V48h112Z" />+ </svg>+ );+}++function IconCheck({ className, ...props }: React.ComponentProps<"svg">) {+ return (+ <svg+ xmlns="http://www.w3.org/2000/svg"+ viewBox="0 0 256 256"+ fill="currentColor"+ className={cn("size-4", className)}+ {...props}+ >+ <path d="m229.66 77.66-128 128a8 8 0 0 1-11.32 0l-56-56a8 8 0 0 1 11.32-11.32L96 188.69 218.34 66.34a8 8 0 0 1 11.32 11.32Z" />+ </svg>+ );+}++function IconDownload({ className, ...props }: React.ComponentProps<"svg">) {+ return (+ <svg+ xmlns="http://www.w3.org/2000/svg"+ viewBox="0 0 256 256"+ fill="currentColor"+ className={cn("size-4", className)}+ {...props}+ >+ <path d="M224 152v56a16 16 0 0 1-16 16H48a16 16 0 0 1-16-16v-56a8 8 0 0 1 16 0v56h160v-56a8 8 0 0 1 16 0Zm-101.66 5.66a8 8 0 0 0 11.32 0l40-40a8 8 0 0 0-11.32-11.32L136 132.69V40a8 8 0 0 0-16 0v92.69l-26.34-26.35a8 8 0 0 0-11.32 11.32Z" />+ </svg>+ );+}++function IconClose({ className, ...props }: React.ComponentProps<"svg">) {+ return (+ <svg+ xmlns="http://www.w3.org/2000/svg"+ viewBox="0 0 256 256"+ fill="currentColor"+ className={cn("size-4", className)}+ {...props}+ >+ <path d="M205.66 194.34a8 8 0 0 1-11.32 11.32L128 139.31l-66.34 66.35a8 8 0 0 1-11.32-11.32L116.69 128 50.34 61.66a8 8 0 0 1 11.32-11.32L128 116.69l66.34-66.35a8 8 0 0 1 11.32 11.32L139.31 128Z" />+ </svg>+ );+}++function IconEdit({ className, ...props }: React.ComponentProps<"svg">) {+ return (+ <svg+ xmlns="http://www.w3.org/2000/svg"+ fill="none"+ viewBox="0 0 24 24"+ strokeWidth={1.5}+ stroke="currentColor"+ className={cn("size-4", className)}+ {...props}+ >+ <path+ strokeLinecap="round"+ strokeLinejoin="round"+ d="M16.862 4.487l1.687-1.688a1.875 1.875 0 112.652 2.652L10.582 16.07a4.5 4.5 0 01-1.897 1.13L6 18l.8-2.685a4.5 4.5 0 011.13-1.897l8.932-8.931zm0 0L19.5 7.125M18 14v4.75A2.25 2.25 0 0115.75 21H5.25A2.25 2.25 0 013 18.75V8.25A2.25 2.25 0 015.25 6H10"+ />+ </svg>+ );+}++function IconShare({ className, ...props }: React.ComponentProps<"svg">) {+ return (+ <svg+ xmlns="http://www.w3.org/2000/svg"+ fill="currentColor"+ className={cn("size-4", className)}+ viewBox="0 0 256 256"+ {...props}+ >+ <path d="m237.66 106.35-80-80A8 8 0 0 0 144 32v40.35c-25.94 2.22-54.59 14.92-78.16 34.91-28.38 24.08-46.05 55.11-49.76 87.37a12 12 0 0 0 20.68 9.58c11-11.71 50.14-48.74 107.24-52V192a8 8 0 0 0 13.66 5.65l80-80a8 8 0 0 0 0-11.3ZM160 172.69V144a8 8 0 0 0-8-8c-28.08 0-55.43 7.33-81.29 21.8a196.17 196.17 0 0 0-36.57 26.52c5.8-23.84 20.42-46.51 42.05-64.86C99.41 99.77 127.75 88 152 88a8 8 0 0 0 8-8V51.32L220.69 112Z" />+ </svg>+ );+}++function IconUsers({ className, ...props }: React.ComponentProps<"svg">) {+ return (+ <svg+ xmlns="http://www.w3.org/2000/svg"+ fill="currentColor"+ className={cn("size-4", className)}+ viewBox="0 0 256 256"+ {...props}+ >+ <path d="M117.25 157.92a60 60 0 1 0-66.5 0 95.83 95.83 0 0 0-47.22 37.71 8 8 0 1 0 13.4 8.74 80 80 0 0 1 134.14 0 8 8 0 0 0 13.4-8.74 95.83 95.83 0 0 0-47.22-37.71ZM40 108a44 44 0 1 1 44 44 44.05 44.05 0 0 1-44-44Zm210.14 98.7a8 8 0 0 1-11.07-2.33A79.83 79.83 0 0 0 172 168a8 8 0 0 1 0-16 44 44 0 1 0-16.34-84.87 8 8 0 1 1-5.94-14.85 60 60 0 0 1 55.53 105.64 95.83 95.83 0 0 1 47.22 37.71 8 8 0 0 1-2.33 11.07Z" />+ </svg>+ );+}++function IconExternalLink({+ className,+ ...props+}: React.ComponentProps<"svg">) {+ return (+ <svg+ xmlns="http://www.w3.org/2000/svg"+ fill="currentColor"+ className={cn("size-4", className)}+ viewBox="0 0 256 256"+ {...props}+ >+ <path d="M224 104a8 8 0 0 1-16 0V59.32l-66.33 66.34a8 8 0 0 1-11.32-11.32L196.68 48H152a8 8 0 0 1 0-16h64a8 8 0 0 1 8 8Zm-40 24a8 8 0 0 0-8 8v72H48V80h72a8 8 0 0 0 0-16H48a16 16 0 0 0-16 16v128a16 16 0 0 0 16 16h128a16 16 0 0 0 16-16v-72a8 8 0 0 0-8-8Z" />+ </svg>+ );+}++function IconChevronUpDown({+ className,+ ...props+}: React.ComponentProps<"svg">) {+ return (+ <svg+ xmlns="http://www.w3.org/2000/svg"+ fill="currentColor"+ className={cn("size-4", className)}+ viewBox="0 0 256 256"+ {...props}+ >+ <path d="M181.66 170.34a8 8 0 0 1 0 11.32l-48 48a8 8 0 0 1-11.32 0l-48-48a8 8 0 0 1 11.32-11.32L128 212.69l42.34-42.35a8 8 0 0 1 11.32 0Zm-96-84.68L128 43.31l42.34 42.35a8 8 0 0 0 11.32-11.32l-48-48a8 8 0 0 0-11.32 0l-48 48a8 8 0 0 0 11.32 11.32Z" />+ </svg>+ );+}++function IconLlama({ className, ...props }: React.ComponentProps<"svg">) {+ return (+ <svg+ fill="currentColor"+ viewBox="0 0 24 24"+ role="img"+ xmlns="http://www.w3.org/2000/svg"+ className={cn("size-4", className)}+ {...props}+ >+ <title>Llama3 icon</title>+ <circle+ cx="12"+ cy="12"+ r="10"+ stroke="currentColor"+ strokeWidth="2"+ fill="none"+ />+ <path+ d="M6 9l6 6 6-6"+ stroke="currentColor"+ strokeWidth="2"+ strokeLinecap="round"+ strokeLinejoin="round"+ />+ </svg>+ );+}++function IconCode({ className, ...props }: React.ComponentProps<"svg">) {+ return (+ <svg+ width="15"+ height="15"+ viewBox="0 0 15 15"+ fill="none"+ xmlns="http://www.w3.org/2000/svg"+ >+ <path+ d="M9.96424 2.68571C10.0668 2.42931 9.94209 2.13833 9.6857 2.03577C9.4293 1.93322 9.13832 2.05792 9.03576 2.31432L5.03576 12.3143C4.9332 12.5707 5.05791 12.8617 5.3143 12.9642C5.5707 13.0668 5.86168 12.9421 5.96424 12.6857L9.96424 2.68571ZM3.85355 5.14646C4.04882 5.34172 4.04882 5.6583 3.85355 5.85356L2.20711 7.50001L3.85355 9.14646C4.04882 9.34172 4.04882 9.6583 3.85355 9.85356C3.65829 10.0488 3.34171 10.0488 3.14645 9.85356L1.14645 7.85356C0.951184 7.6583 0.951184 7.34172 1.14645 7.14646L3.14645 5.14646C3.34171 4.9512 3.65829 4.9512 3.85355 5.14646ZM11.1464 5.14646C11.3417 4.9512 11.6583 4.9512 11.8536 5.14646L13.8536 7.14646C14.0488 7.34172 14.0488 7.6583 13.8536 7.85356L11.8536 9.85356C11.6583 10.0488 11.3417 10.0488 11.1464 9.85356C10.9512 9.6583 10.9512 9.34172 11.1464 9.14646L12.7929 7.50001L11.1464 5.85356C10.9512 5.6583 10.9512 5.34172 11.1464 5.14646Z"+ fill="currentColor"+ fillRule="evenodd"+ clipRule="evenodd"+ ></path>+ </svg>+ );+}++function IconOllama({ className, ...props }: React.ComponentProps<"svg">) {+ return (+ <svg+ width="133"+ height="185"+ viewBox="0 0 133 185"+ fill="none"+ xmlns="http://www.w3.org/2000/svg"+ xmlnsXlink="http://www.w3.org/1999/xlink"+ >+ <rect width="133" height="185" fill="url(#pattern0)" />+ <defs>+ <pattern+ id="pattern0"+ patternContentUnits="objectBoundingBox"+ width="1"+ height="1"+ >+ <use+ xlinkHref="#image0_406_1657"+ transform="matrix(0.00552486 0 0 0.00397193 0 -0.00840675)"+ />+ </pattern>+ <image+ id="image0_406_1657"+ width="181"+ height="256"+ xlinkHref="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAALUAAAEACAYAAAD1IzfbAAAMQGlDQ1BJQ0MgUHJvZmlsZQAASImVVwdYU8kWnluSkEBoAQSkhN4EkRpASggt9I5gIyQBQokxEFTsyKKCa0FFBGzoqoiCFRA7YmdR7H2xoKKsiwW78iYFdN1XvjffN3f++8+Z/5w5d+beOwCoHeeIRDmoOgC5wnxxbLA/fVxyCp30FJAAARCBOjDncPNEzOjocADLUPv38u46QKTtFXup1j/7/2vR4PHzuAAg0RCn8fK4uRDvBwCv4YrE+QAQpbzZtHyRFMMKtMQwQIgXSXGGHNdIcZoc75bZxMeyIG4HQEmFwxFnAKB6CfL0Am4G1FDth9hRyBMIAVCjQ+yTmzuFB3EqxNbQRgSxVJ+R9oNOxt8004Y1OZyMYSyfi6woBQjyRDmcGf9nOv53yc2RDPmwhFUlUxwSK50zzNvN7ClhUqwCcZ8wLTIKYk2IPwh4MnuIUUqmJCRBbo8acPNYMGdAB2JHHicgDGIDiIOEOZHhCj4tXRDEhhiuEHS6IJ8dD7EuxIv4eYFxCpuN4imxCl9oU7qYxVTwZzlimV+pr/uS7ASmQv91Jp+t0MdUCzPjkyCmQGxeIEiMhFgVYoe87Lgwhc3YwkxW5JCNWB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KjXTJLCICAlT/T+FpG6l2NGPPzUUkSAlYErPyZxtcyUu9izOoKo10ySwiAgJU/Xny9RwFCL9gfkk3ZF4RkkyQEfBCAP/AolHvwtU+KRFxDvZaHJ/xvozzhSZIQsCIAf6b+19oAJ/AV3k5JkdRbTfWE7dwYNjyNTgiUImDlUR9vi6TevDRUfePt9UPSiIRALQJWHvXxtkjqdWrDlg/gT2ySJASaImDlUR9vi6TeyJjVfUa7ZJYQyCNg5VEfb4ukzgcI2b8rZHAamxCoQCAKj4qkXrciWF1zWvmoQyj1+yBg5VEfb4uktr6QZD1t+BSaxowPAlYe9fG2SGorfCyaJ0kINEUgCo+KpOZpjkU2sBglm4RAAQErj/p4WyT1tEeOhaBVH9ep6kjtCYEABKw86uNtkdSPBiSQH7p2/kPaTwgYEbD++GMfb4uk7juMByS2acDYNDQhUIXAllUdNe19vC2Smt9gsAg/qZAkIdAUgW2MDvp4WyR137VJQIAdAsamoQmBKgSsPOrjbZHU1mfv0/6kpirr1J4QcCBg5ZGTt/xG2QNSrlFC9GmN71sA1+ckCYEQBOAPPArhHWPha99vPhaP1Ay6QRoqK8vg5aFGaXxCIIcA/IFHoQJf4e2UFElNR/AP7016Sz9kMwVr2jEgYOWPF1/nK6HQUwDjH5bOliZJCIQiAG/gj4V3832CzTE6J6E9fQKkMQmBAgLwxkJobOYUfJX+BfgyDbquONDzc98fQHrapGEJAStvrhd0y4rwlV1TM+as4kCPz89ozE0e49KQhEARAXgDf0Ll22UG/w9yreSQIAJvAgAAAABJRU5ErkJggg=="+ />+ </defs>+ </svg>+ );+}++export {+ IconOllama,+ IconEdit,+ IconNextChat,+ IconOpenAI,+ IconVercel,+ IconGitHub,+ IconSeparator,+ IconArrowDown,+ IconArrowRight,+ IconUser,+ IconPlus,+ IconArrowElbow,+ IconSpinner,+ IconMessage,+ IconTrash,+ IconRefresh,+ IconStop,+ IconSidebar,+ IconMoon,+ IconSun,+ IconCopy,+ IconCheck,+ IconDownload,+ IconClose,+ IconShare,+ IconUsers,+ IconExternalLink,+ IconChevronUpDown,+ IconLlama,+ IconCode,+};diff --git a/pipes/data-table/src/components/ui/input.tsx b/pipes/data-table/src/components/ui/input.tsxnew file mode 100644index 000000000..68551b927--- /dev/null+++ b/pipes/data-table/src/components/ui/input.tsx@@ -0,0 +1,22 @@+import * as React from "react"++import { cn } from "@/lib/utils"++const Input = React.forwardRef<HTMLInputElement, React.ComponentProps<"input">>(+ ({ className, type, ...props }, ref) => {+ return (+ <input+ type={type}+ className={cn(+ "flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",+ className+ )}+ ref={ref}+ {...props}+ />+ )+ }+)+Input.displayName = "Input"++export { Input }diff --git a/pipes/data-table/src/components/ui/label.tsx b/pipes/data-table/src/components/ui/label.tsxnew file mode 100644index 000000000..534182176--- /dev/null+++ b/pipes/data-table/src/components/ui/label.tsx@@ -0,0 +1,26 @@+"use client"++import * as React from "react"+import * as LabelPrimitive from "@radix-ui/react-label"+import { cva, type VariantProps } from "class-variance-authority"++import { cn } from "@/lib/utils"++const labelVariants = cva(+ "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"+)++const Label = React.forwardRef<+ React.ElementRef<typeof LabelPrimitive.Root>,+ React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root> &+ VariantProps<typeof labelVariants>+>(({ className, ...props }, ref) => (+ <LabelPrimitive.Root+ ref={ref}+ className={cn(labelVariants(), className)}+ {...props}+ />+))+Label.displayName = LabelPrimitive.Root.displayName++export { Label }diff --git a/pipes/data-table/src/components/ui/popover.tsx b/pipes/data-table/src/components/ui/popover.tsxnew file mode 100644index 000000000..a0ec48bee--- /dev/null+++ b/pipes/data-table/src/components/ui/popover.tsx@@ -0,0 +1,31 @@+"use client"++import * as React from "react"+import * as PopoverPrimitive from "@radix-ui/react-popover"++import { cn } from "@/lib/utils"++const Popover = PopoverPrimitive.Root++const PopoverTrigger = PopoverPrimitive.Trigger++const PopoverContent = React.forwardRef<+ React.ElementRef<typeof PopoverPrimitive.Content>,+ React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Content>+>(({ className, align = "center", sideOffset = 4, ...props }, ref) => (+ <PopoverPrimitive.Portal>+ <PopoverPrimitive.Content+ ref={ref}+ align={align}+ sideOffset={sideOffset}+ className={cn(+ "z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",+ className+ )}+ {...props}+ />+ </PopoverPrimitive.Portal>+))+PopoverContent.displayName = PopoverPrimitive.Content.displayName++export { Popover, PopoverTrigger, PopoverContent }diff --git a/pipes/data-table/src/components/ui/progress.tsx b/pipes/data-table/src/components/ui/progress.tsxnew file mode 100644index 000000000..5c87ea486--- /dev/null+++ b/pipes/data-table/src/components/ui/progress.tsx@@ -0,0 +1,28 @@+"use client"++import * as React from "react"+import * as ProgressPrimitive from "@radix-ui/react-progress"++import { cn } from "@/lib/utils"++const Progress = React.forwardRef<+ React.ElementRef<typeof ProgressPrimitive.Root>,+ React.ComponentPropsWithoutRef<typeof ProgressPrimitive.Root>+>(({ className, value, ...props }, ref) => (+ <ProgressPrimitive.Root+ ref={ref}+ className={cn(+ "relative h-4 w-full overflow-hidden rounded-full bg-secondary",+ className+ )}+ {...props}+ >+ <ProgressPrimitive.Indicator+ className="h-full w-full flex-1 bg-primary transition-all"+ style={{ transform: `translateX(-${100 - (value || 0)}%)` }}+ />+ </ProgressPrimitive.Root>+))+Progress.displayName = ProgressPrimitive.Root.displayName++export { Progress }diff --git a/pipes/data-table/src/components/ui/select.tsx b/pipes/data-table/src/components/ui/select.tsxnew file mode 100644index 000000000..cbe5a36b6--- /dev/null+++ b/pipes/data-table/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 { Check, ChevronDown, ChevronUp } from "lucide-react"++import { cn } from "@/lib/utils"++const Select = SelectPrimitive.Root++const SelectGroup = SelectPrimitive.Group++const SelectValue = SelectPrimitive.Value++const SelectTrigger = React.forwardRef<+ React.ElementRef<typeof SelectPrimitive.Trigger>,+ React.ComponentPropsWithoutRef<typeof SelectPrimitive.Trigger>+>(({ className, children, ...props }, ref) => (+ <SelectPrimitive.Trigger+ ref={ref}+ className={cn(+ "flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",+ className+ )}+ {...props}+ >+ {children}+ <SelectPrimitive.Icon asChild>+ <ChevronDown className="h-4 w-4 opacity-50" />+ </SelectPrimitive.Icon>+ </SelectPrimitive.Trigger>+))+SelectTrigger.displayName = SelectPrimitive.Trigger.displayName++const SelectScrollUpButton = React.forwardRef<+ React.ElementRef<typeof SelectPrimitive.ScrollUpButton>,+ React.ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollUpButton>+>(({ className, ...props }, ref) => (+ <SelectPrimitive.ScrollUpButton+ ref={ref}+ className={cn(+ "flex cursor-default items-center justify-center py-1",+ className+ )}+ {...props}+ >+ <ChevronUp className="h-4 w-4" />+ </SelectPrimitive.ScrollUpButton>+))+SelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName++const SelectScrollDownButton = React.forwardRef<+ React.ElementRef<typeof SelectPrimitive.ScrollDownButton>,+ React.ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollDownButton>+>(({ className, ...props }, ref) => (+ <SelectPrimitive.ScrollDownButton+ ref={ref}+ className={cn(+ "flex cursor-default items-center justify-center py-1",+ className+ )}+ {...props}+ >+ <ChevronDown className="h-4 w-4" />+ </SelectPrimitive.ScrollDownButton>+))+SelectScrollDownButton.displayName =+ SelectPrimitive.ScrollDownButton.displayName++const SelectContent = React.forwardRef<+ React.ElementRef<typeof SelectPrimitive.Content>,+ React.ComponentPropsWithoutRef<typeof SelectPrimitive.Content>+>(({ className, children, position = "popper", ...props }, ref) => (+ <SelectPrimitive.Portal>+ <SelectPrimitive.Content+ ref={ref}+ className={cn(+ "relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",+ position === "popper" &&+ "data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",+ className+ )}+ position={position}+ {...props}+ >+ <SelectScrollUpButton />+ <SelectPrimitive.Viewport+ className={cn(+ "p-1",+ position === "popper" &&+ "h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"+ )}+ >+ {children}+ </SelectPrimitive.Viewport>+ <SelectScrollDownButton />+ </SelectPrimitive.Content>+ </SelectPrimitive.Portal>+))+SelectContent.displayName = SelectPrimitive.Content.displayName++const SelectLabel = React.forwardRef<+ React.ElementRef<typeof SelectPrimitive.Label>,+ React.ComponentPropsWithoutRef<typeof SelectPrimitive.Label>+>(({ className, ...props }, ref) => (+ <SelectPrimitive.Label+ ref={ref}+ className={cn("py-1.5 pl-8 pr-2 text-sm font-semibold", className)}+ {...props}+ />+))+SelectLabel.displayName = SelectPrimitive.Label.displayName++const SelectItem = React.forwardRef<+ React.ElementRef<typeof SelectPrimitive.Item>,+ React.ComponentPropsWithoutRef<typeof SelectPrimitive.Item>+>(({ className, children, ...props }, ref) => (+ <SelectPrimitive.Item+ ref={ref}+ className={cn(+ "relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",+ className+ )}+ {...props}+ >+ <span className="absolute left-2 flex h-3.5 w-3.5 items-center justify-center">+ <SelectPrimitive.ItemIndicator>+ <Check className="h-4 w-4" />+ </SelectPrimitive.ItemIndicator>+ </span>++ <SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>+ </SelectPrimitive.Item>+))+SelectItem.displayName = SelectPrimitive.Item.displayName++const SelectSeparator = React.forwardRef<+ React.ElementRef<typeof SelectPrimitive.Separator>,+ React.ComponentPropsWithoutRef<typeof SelectPrimitive.Separator>+>(({ className, ...props }, ref) => (+ <SelectPrimitive.Separator+ ref={ref}+ className={cn("-mx-1 my-1 h-px bg-muted", className)}+ {...props}+ />+))+SelectSeparator.displayName = SelectPrimitive.Separator.displayName++export {+ Select,+ SelectGroup,+ SelectValue,+ SelectTrigger,+ SelectContent,+ SelectLabel,+ SelectItem,+ SelectSeparator,+ SelectScrollUpButton,+ SelectScrollDownButton,+}diff --git a/pipes/data-table/src/components/ui/separator.tsx b/pipes/data-table/src/components/ui/separator.tsxnew file mode 100644index 000000000..12d81c4a8--- /dev/null+++ b/pipes/data-table/src/components/ui/separator.tsx@@ -0,0 +1,31 @@+"use client"++import * as React from "react"+import * as SeparatorPrimitive from "@radix-ui/react-separator"++import { cn } from "@/lib/utils"++const Separator = React.forwardRef<+ React.ElementRef<typeof SeparatorPrimitive.Root>,+ React.ComponentPropsWithoutRef<typeof SeparatorPrimitive.Root>+>(+ (+ { className, orientation = "horizontal", decorative = true, ...props },+ ref+ ) => (+ <SeparatorPrimitive.Root+ ref={ref}+ decorative={decorative}+ orientation={orientation}+ className={cn(+ "shrink-0 bg-border",+ orientation === "horizontal" ? "h-[1px] w-full" : "h-full w-[1px]",+ className+ )}+ {...props}+ />+ )+)+Separator.displayName = SeparatorPrimitive.Root.displayName++export { Separator }diff --git a/pipes/data-table/src/components/ui/skeleton.tsx b/pipes/data-table/src/components/ui/skeleton.tsxnew file mode 100644index 000000000..01b8b6d4f--- /dev/null+++ b/pipes/data-table/src/components/ui/skeleton.tsx@@ -0,0 +1,15 @@+import { cn } from "@/lib/utils"++function Skeleton({+ className,+ ...props+}: React.HTMLAttributes<HTMLDivElement>) {+ return (+ <div+ className={cn("animate-pulse rounded-md bg-muted", className)}+ {...props}+ />+ )+}++export { Skeleton }diff --git a/pipes/data-table/src/components/ui/slider.tsx b/pipes/data-table/src/components/ui/slider.tsxnew file mode 100644index 000000000..c31c2b3bc--- /dev/null+++ b/pipes/data-table/src/components/ui/slider.tsx@@ -0,0 +1,28 @@+"use client"++import * as React from "react"+import * as SliderPrimitive from "@radix-ui/react-slider"++import { cn } from "@/lib/utils"++const Slider = React.forwardRef<+ React.ElementRef<typeof SliderPrimitive.Root>,+ React.ComponentPropsWithoutRef<typeof SliderPrimitive.Root>+>(({ className, ...props }, ref) => (+ <SliderPrimitive.Root+ ref={ref}+ className={cn(+ "relative flex w-full touch-none select-none items-center",+ className+ )}+ {...props}+ >+ <SliderPrimitive.Track className="relative h-2 w-full grow overflow-hidden rounded-full bg-secondary">+ <SliderPrimitive.Range className="absolute h-full bg-primary" />+ </SliderPrimitive.Track>+ <SliderPrimitive.Thumb className="block h-5 w-5 rounded-full border-2 border-primary bg-background ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50" />+ </SliderPrimitive.Root>+))+Slider.displayName = SliderPrimitive.Root.displayName++export { Slider }diff --git a/pipes/data-table/src/components/ui/switch.tsx b/pipes/data-table/src/components/ui/switch.tsxnew file mode 100644index 000000000..bc69cf2db--- /dev/null+++ b/pipes/data-table/src/components/ui/switch.tsx@@ -0,0 +1,29 @@+"use client"++import * as React from "react"+import * as SwitchPrimitives from "@radix-ui/react-switch"++import { cn } from "@/lib/utils"++const Switch = React.forwardRef<+ React.ElementRef<typeof SwitchPrimitives.Root>,+ React.ComponentPropsWithoutRef<typeof SwitchPrimitives.Root>+>(({ className, ...props }, ref) => (+ <SwitchPrimitives.Root+ className={cn(+ "peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",+ className+ )}+ {...props}+ ref={ref}+ >+ <SwitchPrimitives.Thumb+ className={cn(+ "pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0"+ )}+ />+ </SwitchPrimitives.Root>+))+Switch.displayName = SwitchPrimitives.Root.displayName++export { Switch }diff --git a/pipes/data-table/src/components/ui/table.tsx b/pipes/data-table/src/components/ui/table.tsxnew file mode 100644index 000000000..7f3502f8b--- /dev/null+++ b/pipes/data-table/src/components/ui/table.tsx@@ -0,0 +1,117 @@+import * as React from "react"++import { cn } from "@/lib/utils"++const Table = React.forwardRef<+ HTMLTableElement,+ React.HTMLAttributes<HTMLTableElement>+>(({ className, ...props }, ref) => (+ <div className="relative w-full overflow-auto">+ <table+ ref={ref}+ className={cn("w-full caption-bottom text-sm", className)}+ {...props}+ />+ </div>+))+Table.displayName = "Table"++const TableHeader = React.forwardRef<+ HTMLTableSectionElement,+ React.HTMLAttributes<HTMLTableSectionElement>+>(({ className, ...props }, ref) => (+ <thead ref={ref} className={cn("[&_tr]:border-b", className)} {...props} />+))+TableHeader.displayName = "TableHeader"++const TableBody = React.forwardRef<+ HTMLTableSectionElement,+ React.HTMLAttributes<HTMLTableSectionElement>+>(({ className, ...props }, ref) => (+ <tbody+ ref={ref}+ className={cn("[&_tr:last-child]:border-0", className)}+ {...props}+ />+))+TableBody.displayName = "TableBody"++const TableFooter = React.forwardRef<+ HTMLTableSectionElement,+ React.HTMLAttributes<HTMLTableSectionElement>+>(({ className, ...props }, ref) => (+ <tfoot+ ref={ref}+ className={cn(+ "border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",+ className+ )}+ {...props}+ />+))+TableFooter.displayName = "TableFooter"++const TableRow = React.forwardRef<+ HTMLTableRowElement,+ React.HTMLAttributes<HTMLTableRowElement>+>(({ className, ...props }, ref) => (+ <tr+ ref={ref}+ className={cn(+ "border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",+ className+ )}+ {...props}+ />+))+TableRow.displayName = "TableRow"++const TableHead = React.forwardRef<+ HTMLTableCellElement,+ React.ThHTMLAttributes<HTMLTableCellElement>+>(({ className, ...props }, ref) => (+ <th+ ref={ref}+ className={cn(+ "h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",+ className+ )}+ {...props}+ />+))+TableHead.displayName = "TableHead"++const TableCell = React.forwardRef<+ HTMLTableCellElement,+ React.TdHTMLAttributes<HTMLTableCellElement>+>(({ className, ...props }, ref) => (+ <td+ ref={ref}+ className={cn("p-4 align-middle [&:has([role=checkbox])]:pr-0", className)}+ {...props}+ />+))+TableCell.displayName = "TableCell"++const TableCaption = React.forwardRef<+ HTMLTableCaptionElement,+ React.HTMLAttributes<HTMLTableCaptionElement>+>(({ className, ...props }, ref) => (+ <caption+ ref={ref}+ className={cn("mt-4 text-sm text-muted-foreground", className)}+ {...props}+ />+))+TableCaption.displayName = "TableCaption"++export {+ Table,+ TableHeader,+ TableBody,+ TableFooter,+ TableHead,+ TableRow,+ TableCell,+ TableCaption,+}diff --git a/pipes/data-table/src/components/ui/toast.tsx b/pipes/data-table/src/components/ui/toast.tsxnew file mode 100644index 000000000..521b94b07--- /dev/null+++ b/pipes/data-table/src/components/ui/toast.tsx@@ -0,0 +1,129 @@+"use client"++import * as React from "react"+import * as ToastPrimitives from "@radix-ui/react-toast"+import { cva, type VariantProps } from "class-variance-authority"+import { X } from "lucide-react"++import { cn } from "@/lib/utils"++const ToastProvider = ToastPrimitives.Provider++const ToastViewport = React.forwardRef<+ React.ElementRef<typeof ToastPrimitives.Viewport>,+ React.ComponentPropsWithoutRef<typeof ToastPrimitives.Viewport>+>(({ className, ...props }, ref) => (+ <ToastPrimitives.Viewport+ ref={ref}+ className={cn(+ "fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",+ className+ )}+ {...props}+ />+))+ToastViewport.displayName = ToastPrimitives.Viewport.displayName++const toastVariants = cva(+ "group pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border p-6 pr-8 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",+ {+ variants: {+ variant: {+ default: "border bg-background text-foreground",+ destructive:+ "destructive group border-destructive bg-destructive text-destructive-foreground",+ },+ },+ defaultVariants: {+ variant: "default",+ },+ }+)++const Toast = React.forwardRef<+ React.ElementRef<typeof ToastPrimitives.Root>,+ React.ComponentPropsWithoutRef<typeof ToastPrimitives.Root> &+ VariantProps<typeof toastVariants>+>(({ className, variant, ...props }, ref) => {+ return (+ <ToastPrimitives.Root+ ref={ref}+ className={cn(toastVariants({ variant }), className)}+ {...props}+ />+ )+})+Toast.displayName = ToastPrimitives.Root.displayName++const ToastAction = React.forwardRef<+ React.ElementRef<typeof ToastPrimitives.Action>,+ React.ComponentPropsWithoutRef<typeof ToastPrimitives.Action>+>(({ className, ...props }, ref) => (+ <ToastPrimitives.Action+ ref={ref}+ className={cn(+ "inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium ring-offset-background transition-colors hover:bg-secondary focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive",+ className+ )}+ {...props}+ />+))+ToastAction.displayName = ToastPrimitives.Action.displayName++const ToastClose = React.forwardRef<+ React.ElementRef<typeof ToastPrimitives.Close>,+ React.ComponentPropsWithoutRef<typeof ToastPrimitives.Close>+>(({ className, ...props }, ref) => (+ <ToastPrimitives.Close+ ref={ref}+ className={cn(+ "absolute right-2 top-2 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-2 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",+ className+ )}+ toast-close=""+ {...props}+ >+ <X className="h-4 w-4" />+ </ToastPrimitives.Close>+))+ToastClose.displayName = ToastPrimitives.Close.displayName++const ToastTitle = React.forwardRef<+ React.ElementRef<typeof ToastPrimitives.Title>,+ React.ComponentPropsWithoutRef<typeof ToastPrimitives.Title>+>(({ className, ...props }, ref) => (+ <ToastPrimitives.Title+ ref={ref}+ className={cn("text-sm font-semibold", className)}+ {...props}+ />+))+ToastTitle.displayName = ToastPrimitives.Title.displayName++const ToastDescription = React.forwardRef<+ React.ElementRef<typeof ToastPrimitives.Description>,+ React.ComponentPropsWithoutRef<typeof ToastPrimitives.Description>+>(({ className, ...props }, ref) => (+ <ToastPrimitives.Description+ ref={ref}+ className={cn("text-sm opacity-90", className)}+ {...props}+ />+))+ToastDescription.displayName = ToastPrimitives.Description.displayName++type ToastProps = React.ComponentPropsWithoutRef<typeof Toast>++type ToastActionElement = React.ReactElement<typeof ToastAction>++export {+ type ToastProps,+ type ToastActionElement,+ ToastProvider,+ ToastViewport,+ Toast,+ ToastTitle,+ ToastDescription,+ ToastClose,+ ToastAction,+}diff --git a/pipes/data-table/src/components/ui/toaster.tsx b/pipes/data-table/src/components/ui/toaster.tsxnew file mode 100644index 000000000..fe7103d70--- /dev/null+++ b/pipes/data-table/src/components/ui/toaster.tsx@@ -0,0 +1,35 @@+"use client"++import { useToast } from "@/components/ui/use-toast"+import {+ Toast,+ ToastClose,+ ToastDescription,+ ToastProvider,+ ToastTitle,+ ToastViewport,+} from "@/components/ui/toast"++export function Toaster() {+ const { toasts } = useToast()++ return (+ <ToastProvider>+ {toasts.map(function ({ id, title, description, action, ...props }) {+ return (+ <Toast key={id} {...props}>+ <div className="grid gap-1">+ {title && <ToastTitle>{title}</ToastTitle>}+ {description && (+ <ToastDescription>{description}</ToastDescription>+ )}+ </div>+ {action}+ <ToastClose />+ </Toast>+ )+ })}+ <ToastViewport />+ </ToastProvider>+ )+}diff --git a/pipes/data-table/src/components/ui/tooltip.tsx b/pipes/data-table/src/components/ui/tooltip.tsxnew file mode 100644index 000000000..30fc44d90--- /dev/null+++ b/pipes/data-table/src/components/ui/tooltip.tsx@@ -0,0 +1,30 @@+"use client"++import * as React from "react"+import * as TooltipPrimitive from "@radix-ui/react-tooltip"++import { cn } from "@/lib/utils"++const TooltipProvider = TooltipPrimitive.Provider++const Tooltip = TooltipPrimitive.Root++const TooltipTrigger = TooltipPrimitive.Trigger++const TooltipContent = React.forwardRef<+ React.ElementRef<typeof TooltipPrimitive.Content>,+ React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Content>+>(({ className, sideOffset = 4, ...props }, ref) => (+ <TooltipPrimitive.Content+ ref={ref}+ sideOffset={sideOffset}+ className={cn(+ "z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",+ className+ )}+ {...props}+ />+))+TooltipContent.displayName = TooltipPrimitive.Content.displayName++export { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider }diff --git a/pipes/data-table/src/components/ui/use-toast.ts b/pipes/data-table/src/components/ui/use-toast.tsnew file mode 100644index 000000000..02e111d81--- /dev/null+++ b/pipes/data-table/src/components/ui/use-toast.ts@@ -0,0 +1,194 @@+"use client"++// Inspired by react-hot-toast library+import * as React from "react"++import type {+ ToastActionElement,+ ToastProps,+} from "@/components/ui/toast"++const TOAST_LIMIT = 1+const TOAST_REMOVE_DELAY = 1000000++type ToasterToast = ToastProps & {+ id: string+ title?: React.ReactNode+ description?: React.ReactNode+ action?: ToastActionElement+}++const actionTypes = {+ ADD_TOAST: "ADD_TOAST",+ UPDATE_TOAST: "UPDATE_TOAST",+ DISMISS_TOAST: "DISMISS_TOAST",+ REMOVE_TOAST: "REMOVE_TOAST",+} as const++let count = 0++function genId() {+ count = (count + 1) % Number.MAX_SAFE_INTEGER+ return count.toString()+}++type ActionType = typeof actionTypes++type Action =+ | {+ type: ActionType["ADD_TOAST"]+ toast: ToasterToast+ }+ | {+ type: ActionType["UPDATE_TOAST"]+ toast: Partial<ToasterToast>+ }+ | {+ type: ActionType["DISMISS_TOAST"]+ toastId?: ToasterToast["id"]+ }+ | {+ type: ActionType["REMOVE_TOAST"]+ toastId?: ToasterToast["id"]+ }++interface State {+ toasts: ToasterToast[]+}++const toastTimeouts = new Map<string, ReturnType<typeof setTimeout>>()++const addToRemoveQueue = (toastId: string) => {+ if (toastTimeouts.has(toastId)) {+ return+ }++ const timeout = setTimeout(() => {+ toastTimeouts.delete(toastId)+ dispatch({+ type: "REMOVE_TOAST",+ toastId: toastId,+ })+ }, TOAST_REMOVE_DELAY)++ toastTimeouts.set(toastId, timeout)+}++export const reducer = (state: State, action: Action): State => {+ switch (action.type) {+ case "ADD_TOAST":+ return {+ ...state,+ toasts: [action.toast, ...state.toasts].slice(0, TOAST_LIMIT),+ }++ case "UPDATE_TOAST":+ return {+ ...state,+ toasts: state.toasts.map((t) =>+ t.id === action.toast.id ? { ...t, ...action.toast } : t+ ),+ }++ case "DISMISS_TOAST": {+ const { toastId } = action++ // ! Side effects ! - This could be extracted into a dismissToast() action,+ // but I'll keep it here for simplicity+ if (toastId) {+ addToRemoveQueue(toastId)+ } else {+ state.toasts.forEach((toast) => {+ addToRemoveQueue(toast.id)+ })+ }++ return {+ ...state,+ toasts: state.toasts.map((t) =>+ t.id === toastId || toastId === undefined+ ? {+ ...t,+ open: false,+ }+ : t+ ),+ }+ }+ case "REMOVE_TOAST":+ if (action.toastId === undefined) {+ return {+ ...state,+ toasts: [],+ }+ }+ return {+ ...state,+ toasts: state.toasts.filter((t) => t.id !== action.toastId),+ }+ }+}++const listeners: Array<(state: State) => void> = []++let memoryState: State = { toasts: [] }++function dispatch(action: Action) {+ memoryState = reducer(memoryState, action)+ listeners.forEach((listener) => {+ listener(memoryState)+ })+}++type Toast = Omit<ToasterToast, "id">++function toast({ ...props }: Toast) {+ const id = genId()++ const update = (props: ToasterToast) =>+ dispatch({+ type: "UPDATE_TOAST",+ toast: { ...props, id },+ })+ const dismiss = () => dispatch({ type: "DISMISS_TOAST", toastId: id })++ dispatch({+ type: "ADD_TOAST",+ toast: {+ ...props,+ id,+ open: true,+ onOpenChange: (open) => {+ if (!open) dismiss()+ },+ },+ })++ return {+ id: id,+ dismiss,+ update,+ }+}++function useToast() {+ const [state, setState] = React.useState<State>(memoryState)++ React.useEffect(() => {+ listeners.push(setState)+ return () => {+ const index = listeners.indexOf(setState)+ if (index > -1) {+ listeners.splice(index, 1)+ }+ }+ }, [state])++ return {+ ...state,+ toast,+ dismiss: (toastId?: string) => dispatch({ type: "DISMISS_TOAST", toastId }),+ }+}++export { useToast, toast }diff --git a/pipes/data-table/src/components/video-chunks-table.tsx b/pipes/data-table/src/components/video-chunks-table.tsxnew file mode 100644index 000000000..284d537fc--- /dev/null+++ b/pipes/data-table/src/components/video-chunks-table.tsx@@ -0,0 +1,441 @@+"use client";++import * as React from "react";+import {+ ColumnDef,+ ColumnFiltersState,+ SortingState,+ VisibilityState,+ flexRender,+ getCoreRowModel,+ getSortedRowModel,+ useReactTable,+} from "@tanstack/react-table";+import {+ ArrowUpDown,+ ChevronDown,+ MoreHorizontal,+ RefreshCw,+} from "lucide-react";++import { Button } from "@/components/ui/button";+import {+ DropdownMenu,+ DropdownMenuCheckboxItem,+ DropdownMenuContent,+ DropdownMenuItem,+ DropdownMenuLabel,+ DropdownMenuTrigger,+} from "@/components/ui/dropdown-menu";+import { Input } from "@/components/ui/input";+import {+ Table,+ TableBody,+ TableCell,+ TableHead,+ TableHeader,+ TableRow,+} from "@/components/ui/table";+import {+ Select,+ SelectContent,+ SelectGroup,+ SelectItem,+ SelectLabel,+ SelectTrigger,+ SelectValue,+} from "@/components/ui/select";++interface VideoChunk {+ id: number;+ file_path: string;+ device_name: string;+}++interface MonitorDevice {+ id: string;+ name: string;+ is_default: boolean;+ width: number;+ height: number;+}++const columns: ColumnDef<VideoChunk>[] = [+ {+ accessorKey: "id",+ header: ({ column }) => {+ return (+ <Button+ variant="ghost"+ onClick={() => column.toggleSorting(column.getIsSorted() === "asc")}+ >+ ID+ <ArrowUpDown className="ml-2 h-4 w-4" />+ </Button>+ );+ },+ },+ {+ accessorKey: "file_path",+ header: ({ column }) => {+ return (+ <Button+ variant="ghost"+ onClick={() => column.toggleSorting(column.getIsSorted() === "asc")}+ >+ File Path+ <ArrowUpDown className="ml-2 h-4 w-4" />+ </Button>+ );+ },+ },+ {+ accessorKey: "device_name",+ header: ({ column }) => {+ return (+ <Button+ variant="ghost"+ onClick={() => column.toggleSorting(column.getIsSorted() === "asc")}+ >+ Device Name+ <ArrowUpDown className="ml-2 h-4 w-4" />+ </Button>+ );+ },+ },+ {+ id: "actions",+ cell: ({ row }) => {+ const videoChunk = row.original;++ return (+ <DropdownMenu>+ <DropdownMenuTrigger asChild>+ <Button variant="ghost" className="h-8 w-8 p-0">+ <span className="sr-only">open menu</span>+ <MoreHorizontal className="h-4 w-4" />+ </Button>+ </DropdownMenuTrigger>+ <DropdownMenuContent align="end">+ <DropdownMenuLabel>actions</DropdownMenuLabel>+ <DropdownMenuItem+ onClick={() =>+ navigator.clipboard.writeText(videoChunk.file_path)+ }+ >+ copy path+ </DropdownMenuItem>+ <DropdownMenuItem+ onClick={() =>+ navigator.clipboard.writeText(JSON.stringify(videoChunk))+ }+ >+ copy raw data+ </DropdownMenuItem>+ </DropdownMenuContent>+ </DropdownMenu>+ );+ },+ },+];++export function VideoChunksTable() {+ const [data, setData] = React.useState<VideoChunk[]>([]);+ const [sorting, setSorting] = React.useState<SortingState>([]);+ const [columnFilters] = React.useState<ColumnFiltersState>(+ []+ );+ const [columnVisibility, setColumnVisibility] =+ React.useState<VisibilityState>({});+ const [isLoading, setIsLoading] = React.useState(false);+ const [error, setError] = React.useState<string | null>(null);++ const [pageSize, setPageSize] = React.useState(10);+ const [pageIndex, setPageIndex] = React.useState(0);+ const [totalRows, setTotalRows] = React.useState(0);+ const [filePathFilter] = React.useState("");+ const [deviceFilter, setDeviceFilter] = React.useState("");+ const [availableMonitors, setAvailableMonitors] = React.useState<+ MonitorDevice[]+ >([]);++ const fetchData = async () => {+ setIsLoading(true);+ setError(null);+ try {+ const filterClauses = [+ filePathFilter+ ? `LOWER(file_path) LIKE '%${filePathFilter+ .toLowerCase()+ .replace(/'/g, "''")}%'`+ : null,+ deviceFilter+ ? `LOWER(device_name) LIKE '%${deviceFilter+ .toLowerCase()+ .replace(/'/g, "''")}%'`+ : null,+ ]+ .filter(Boolean)+ .join(" AND ");++ const whereClause = filterClauses ? `WHERE ${filterClauses}` : "";++ // Get total count+ const countResponse = await fetch("http://localhost:3030/raw_sql", {+ method: "POST",+ headers: { "Content-Type": "application/json" },+ body: JSON.stringify({+ query: `SELECT COUNT(*) as total FROM video_chunks ${whereClause}`,+ }),+ });++ if (!countResponse.ok) throw new Error("failed to fetch count");+ const countResult = await countResponse.json();+ setTotalRows(countResult[0].total);++ // Get paginated data+ const response = await fetch("http://localhost:3030/raw_sql", {+ method: "POST",+ headers: { "Content-Type": "application/json" },+ body: JSON.stringify({+ query: `+ SELECT * FROM video_chunks+ ${whereClause}+ ORDER BY id DESC+ LIMIT ${pageSize}+ OFFSET ${pageIndex * pageSize}+ `,+ }),+ });++ if (!response.ok) throw new Error("failed to fetch data");+ const result = await response.json();+ setData(result);+ } catch (error) {+ console.error("error fetching data:", error);+ setError(+ `failed to load video chunks: ${+ error instanceof Error ? error.message : "unknown error"+ }`+ );+ } finally {+ setIsLoading(false);+ }+ };++ // Add monitor loading function+ const loadMonitors = async () => {+ try {+ const response = await fetch("http://localhost:3030/vision/list", {+ method: "POST",+ });+ if (!response.ok) throw new Error("failed to fetch monitors");+ const monitors: MonitorDevice[] = await response.json();+ setAvailableMonitors(monitors);+ } catch (error) {+ console.error("failed to load monitors:", error);+ }+ };++ // Add useEffect for monitors+ React.useEffect(() => {+ loadMonitors();+ }, []);++ React.useEffect(() => {+ const timer = setTimeout(() => {+ fetchData();+ }, 300);++ return () => clearTimeout(timer);+ }, [filePathFilter, deviceFilter, pageIndex, pageSize]);++ // Modify the table configuration+ const table = useReactTable({+ data,+ columns,+ onSortingChange: setSorting,+ getCoreRowModel: getCoreRowModel(),+ manualPagination: true,+ manualFiltering: true,+ pageCount: Math.ceil(totalRows / pageSize),+ onPaginationChange: (updater) => {+ if (typeof updater === "function") {+ const newState = updater({ pageIndex, pageSize });+ setPageIndex(newState.pageIndex);+ setPageSize(newState.pageSize);+ }+ },+ getSortedRowModel: getSortedRowModel(),+ onColumnVisibilityChange: setColumnVisibility,+ state: {+ sorting,+ columnFilters,+ columnVisibility,+ pagination: {+ pageIndex,+ pageSize,+ },+ },+ });++ return (+ <div className="w-full">+ <div className="flex items-center justify-between py-4">+ <div className="flex items-center space-x-4">+ <Input+ placeholder="filter by file path..."+ value={+ (table.getColumn("file_path")?.getFilterValue() as string) ?? ""+ }+ onChange={(event) =>+ table.getColumn("file_path")?.setFilterValue(event.target.value)+ }+ className="max-w-sm"+ />+ {availableMonitors.length > 0 && (+ <Select+ value={deviceFilter}+ onValueChange={(value) => {+ setDeviceFilter(value);+ setPageIndex(0);+ }}+ >+ <SelectTrigger className="w-[200px]">+ <SelectValue placeholder="filter by device..." />+ </SelectTrigger>+ <SelectContent>+ <SelectGroup>+ <SelectLabel>monitors</SelectLabel>+ {availableMonitors.map((monitor) => (+ <SelectItem key={monitor.id} value={`monitor_${monitor.id}`}>+ {monitor.name} {monitor.is_default && "(default)"}+ </SelectItem>+ ))}+ </SelectGroup>+ </SelectContent>+ </Select>+ )}++ <Button+ variant="outline"+ size="icon"+ onClick={fetchData}+ disabled={isLoading}+ >+ <RefreshCw+ className={`h-4 w-4 ${isLoading ? "animate-spin" : ""}`}+ />+ </Button>+ </div>+ <DropdownMenu>+ <DropdownMenuTrigger asChild>+ <Button variant="outline">+ columns <ChevronDown className="ml-2 h-4 w-4" />+ </Button>+ </DropdownMenuTrigger>+ <DropdownMenuContent align="end">+ {table+ .getAllColumns()+ .filter((column) => column.getCanHide())+ .map((column) => {+ return (+ <DropdownMenuCheckboxItem+ key={column.id}+ className="capitalize"+ checked={column.getIsVisible()}+ onCheckedChange={(value) =>+ column.toggleVisibility(!!value)+ }+ >+ {column.id}+ </DropdownMenuCheckboxItem>+ );+ })}+ </DropdownMenuContent>+ </DropdownMenu>+ </div>+ {error ? (+ <div className="text-center text-red-500 py-4">{error}</div>+ ) : (+ <div className="rounded-md border">+ <Table>+ <TableHeader>+ {table.getHeaderGroups().map((headerGroup) => (+ <TableRow key={headerGroup.id}>+ {headerGroup.headers.map((header) => {+ return (+ <TableHead key={header.id}>+ {header.isPlaceholder+ ? null+ : flexRender(+ header.column.columnDef.header,+ header.getContext()+ )}+ </TableHead>+ );+ })}+ </TableRow>+ ))}+ </TableHeader>+ <TableBody>+ {isLoading ? (+ <TableRow>+ <TableCell+ colSpan={columns.length}+ className="h-24 text-center"+ >+ loading...+ </TableCell>+ </TableRow>+ ) : table.getRowModel().rows?.length ? (+ table.getRowModel().rows.map((row) => (+ <TableRow+ key={row.id}+ data-state={row.getIsSelected() && "selected"}+ >+ {row.getVisibleCells().map((cell) => (+ <TableCell key={cell.id}>+ {flexRender(+ cell.column.columnDef.cell,+ cell.getContext()+ )}+ </TableCell>+ ))}+ </TableRow>+ ))+ ) : (+ <TableRow>+ <TableCell+ colSpan={columns.length}+ className="h-24 text-center"+ >+ no results.+ </TableCell>+ </TableRow>+ )}+ </TableBody>+ </Table>+ </div>+ )}+ <div className="flex items-center justify-end space-x-2 py-4">+ <Button+ variant="outline"+ size="sm"+ onClick={() => table.previousPage()}+ disabled={!table.getCanPreviousPage()}+ >+ previous+ </Button>+ <Button+ variant="outline"+ size="sm"+ onClick={() => table.nextPage()}+ disabled={!table.getCanNextPage()}+ >+ next+ </Button>+ </div>+ </div>+ );+}diff --git a/pipes/data-table/src/lib/actions/video-actions.ts b/pipes/data-table/src/lib/actions/video-actions.tsnew file mode 100644index 000000000..9238c9e96--- /dev/null+++ b/pipes/data-table/src/lib/actions/video-actions.ts@@ -0,0 +1,35 @@+'use server'++import { readFile } from 'node:fs/promises'+import { resolve } from 'node:path'++export async function getMediaFile(filePath: string): Promise<{ data: string; mimeType: string }> {+ try {+ const absolutePath = resolve(filePath)+ const buffer = await readFile(absolutePath)+ // convert to base64+ const data = buffer.toString('base64')++ const getMimeType = (path: string): string => {+ const ext = path.split('.').pop()?.toLowerCase()+ const isAudio = path.toLowerCase().includes('input') || path.toLowerCase().includes('output')++ switch (ext) {+ case 'mp4': return 'video/mp4'+ case 'webm': return 'video/webm'+ case 'ogg': return 'video/ogg'+ case 'mp3': return 'audio/mpeg'+ case 'wav': return 'audio/wav'+ default: return isAudio ? 'audio/mpeg' : 'video/mp4'+ }+ }++ return {+ data,+ mimeType: getMimeType(filePath)+ }+ } catch (error) {+ console.error('failed to read media file:', error)+ throw new Error(`failed to read media file: ${error instanceof Error ? error.message : 'unknown error'}`)+ }+}diff --git a/pipes/data-table/src/lib/hooks/use-copy-to-clipboard.tsx b/pipes/data-table/src/lib/hooks/use-copy-to-clipboard.tsxnew file mode 100644index 000000000..e011d69bd--- /dev/null+++ b/pipes/data-table/src/lib/hooks/use-copy-to-clipboard.tsx@@ -0,0 +1,33 @@+"use client";++import * as React from "react";++export interface useCopyToClipboardProps {+ timeout?: number;+}++export function useCopyToClipboard({+ timeout = 2000,+}: useCopyToClipboardProps) {+ const [isCopied, setIsCopied] = React.useState<Boolean>(false);++ const copyToClipboard = (value: string) => {+ if (typeof window === "undefined" || !navigator.clipboard?.writeText) {+ return;+ }++ if (!value) {+ return;+ }++ navigator.clipboard.writeText(value).then(() => {+ setIsCopied(true);++ setTimeout(() => {+ setIsCopied(false);+ }, timeout);+ });+ };++ return { isCopied, copyToClipboard };+}diff --git a/pipes/data-table/src/lib/hooks/use-debounce.tsx b/pipes/data-table/src/lib/hooks/use-debounce.tsxnew file mode 100644index 000000000..ba49720b5--- /dev/null+++ b/pipes/data-table/src/lib/hooks/use-debounce.tsx@@ -0,0 +1,17 @@+import { useState, useEffect } from "react";++export function useDebounce<T>(value: T, delay: number): T {+ const [debouncedValue, setDebouncedValue] = useState<T>(value);++ useEffect(() => {+ const handler = setTimeout(() => {+ setDebouncedValue(value);+ }, delay);++ return () => {+ clearTimeout(handler);+ };+ }, [value, delay]);++ return debouncedValue;+}diff --git a/pipes/data-table/src/lib/hooks/use-health-check.tsx b/pipes/data-table/src/lib/hooks/use-health-check.tsxnew file mode 100644index 000000000..8d32570d0--- /dev/null+++ b/pipes/data-table/src/lib/hooks/use-health-check.tsx@@ -0,0 +1,131 @@+import { useState, useEffect, useCallback, useRef } from "react";++import { debounce } from "lodash";+++interface HealthCheckResponse {+ status: string;+ status_code: number;+ last_frame_timestamp: string | null;+ last_audio_timestamp: string | null;+ last_ui_timestamp: string | null;+ frame_status: string;+ audio_status: string;+ ui_status: string;+ message: string;+}++function isHealthChanged(+ oldHealth: HealthCheckResponse | null,+ newHealth: HealthCheckResponse+): boolean {+ if (!oldHealth) return true;+ return (+ oldHealth.status !== newHealth.status ||+ oldHealth.status_code !== newHealth.status_code ||+ oldHealth.last_frame_timestamp !== newHealth.last_frame_timestamp ||+ oldHealth.last_audio_timestamp !== newHealth.last_audio_timestamp ||+ oldHealth.last_ui_timestamp !== newHealth.last_ui_timestamp ||+ oldHealth.frame_status !== newHealth.frame_status ||+ oldHealth.audio_status !== newHealth.audio_status ||+ oldHealth.ui_status !== newHealth.ui_status ||+ oldHealth.message !== newHealth.message+ );+}++interface HealthCheckHook {+ health: HealthCheckResponse | null;+ isServerDown: boolean;+ isLoading: boolean;+ fetchHealth: () => Promise<void>;+ debouncedFetchHealth: () => Promise<void>;+}++export function useHealthCheck() {+ const [health, setHealth] = useState<HealthCheckResponse | null>(null);+ const [isServerDown, setIsServerDown] = useState(false);+ const [isLoading, setIsLoading] = useState(false);+ const abortControllerRef = useRef<AbortController | null>(null);+ const healthRef = useRef(health);++ const fetchHealth = useCallback(async () => {+ if (abortControllerRef.current) {+ abortControllerRef.current.abort();+ }++ abortControllerRef.current = new AbortController();++ try {+ setIsLoading(true);+ const response = await fetch("http://localhost:3030/health", {+ cache: "no-store",+ signal: abortControllerRef.current.signal,+ headers: {+ "Cache-Control": "no-cache",+ Pragma: "no-cache",+ },+ });++ if (!response.ok) {+ throw new Error(`HTTP error! status: ${response.status}`);+ }++ const data: HealthCheckResponse = await response.json();++ if (isHealthChanged(healthRef.current, data)) {+ setHealth(data);+ healthRef.current = data;+ }++ setIsServerDown(false);+ } catch (error) {+ if (error instanceof Error && error.name === "AbortError") {+ return;+ }++ // console.error("Health check error:", error);+ if (!isServerDown) {+ setIsServerDown(true);+ const errorHealth: HealthCheckResponse = {+ last_frame_timestamp: null,+ last_audio_timestamp: null,+ last_ui_timestamp: null,+ frame_status: "error",+ audio_status: "error",+ ui_status: "error",+ status: "error",+ status_code: 500,+ message: "Failed to fetch health status. Server might be down.",+ };+ setHealth(errorHealth);+ healthRef.current = errorHealth;+ }+ } finally {+ setIsLoading(false);+ }+ }, [isServerDown, setIsLoading]);++ const debouncedFetchHealth = useCallback(debounce(fetchHealth, 200), [+ fetchHealth,+ ]);++ useEffect(() => {+ fetchHealth();+ const interval = setInterval(fetchHealth, 1000);++ return () => {+ clearInterval(interval);+ if (abortControllerRef.current) {+ abortControllerRef.current.abort();+ }+ };+ }, [fetchHealth]);++ return {+ health,+ isServerDown,+ isLoading,+ fetchHealth,+ debouncedFetchHealth,+ } as HealthCheckHook;+}diff --git a/pipes/data-table/src/lib/hooks/use-search-history.tsx b/pipes/data-table/src/lib/hooks/use-search-history.tsxnew file mode 100644index 000000000..4673e3e22--- /dev/null+++ b/pipes/data-table/src/lib/hooks/use-search-history.tsx@@ -0,0 +1,127 @@+"use client";++import { useEffect, useState } from 'react';+import localforage from 'localforage';++export interface SearchHistory {+ id: string;+ query: string;+ timestamp: string;+ searchParams: {+ q?: string;+ content_type: string;+ limit: number;+ offset: number;+ start_time: string;+ end_time: string;+ app_name?: string;+ window_name?: string;+ include_frames: boolean;+ min_length: number;+ max_length: number;+ };+ results: any[];+ messages: {+ id: string;+ type: 'search' | 'ai';+ content: string;+ timestamp: string;+ }[];+ }++const HISTORY_KEY = 'screenpipe-search-history';++export function useSearchHistory() {+ const [searches, setSearches] = useState<SearchHistory[]>([]);+ const [currentSearchId, setCurrentSearchId] = useState<string | null>(null);+ const [isLoading, setIsLoading] = useState(true);+ const [isCollapsed, setIsCollapsed] = useState(true);++ useEffect(() => {+ loadSearches();+ }, []);++ const loadSearches = async () => {+ try {+ const stored = await localforage.getItem<SearchHistory[]>(HISTORY_KEY);+ setSearches(stored || []);+ } catch (error) {+ console.error('failed to load search history:', error);+ }+ setIsLoading(false);+ };++ const saveSearches = async (updated: SearchHistory[]) => {+ try {+ await localforage.setItem(HISTORY_KEY, updated);+ setSearches(updated);+ } catch (error) {+ console.error('failed to save search history:', error);+ }+ };++ const addSearch = async (searchParams: any, results: any[]) => {+ const timestamp = new Date().toISOString();+ const newSearch: SearchHistory = {+ id: crypto.randomUUID(),+ query: searchParams.q || '',+ timestamp,+ searchParams,+ results,+ messages: [{+ id: crypto.randomUUID(),+ type: 'search' as const,+ content: searchParams.q || '',+ timestamp+ }]+ };++ const updated = [newSearch, ...searches];+ await saveSearches(updated);+ setCurrentSearchId(newSearch.id);+ return newSearch.id;+ };++ const addAIResponse = async (searchId: string, response: string) => {+ const timestamp = new Date().toISOString();+ const updated = searches.map(search => {+ if (search.id === searchId) {+ return {+ ...search,+ messages: [...search.messages, {+ id: crypto.randomUUID(),+ type: 'ai' as const,+ content: response,+ timestamp+ }]+ };+ }+ return search;+ });+ await saveSearches(updated);+ };++ const deleteSearch = async (id: string) => {+ const updated = searches.filter(s => s.id !== id);+ await saveSearches(updated);+ if (currentSearchId === id) {+ setCurrentSearchId(null);+ }+ };++ const toggleCollapse = () => {+ setIsCollapsed(!isCollapsed);+ };++ return {+ searches,+ currentSearchId,+ setCurrentSearchId,+ addSearch,+ addAIResponse,+ deleteSearch,+ isLoading,+ isCollapsed,+ toggleCollapse+ };+}diff --git a/pipes/data-table/src/lib/hooks/use-settings.tsx b/pipes/data-table/src/lib/hooks/use-settings.tsxnew file mode 100644index 000000000..f949d6458--- /dev/null+++ b/pipes/data-table/src/lib/hooks/use-settings.tsx@@ -0,0 +1,103 @@+"use client";++import { useState, useEffect } from "react";+import type { Settings } from "@screenpipe/js";++export function useSettings() {+ const defaultSettings: Settings = {+ openaiApiKey: "",+ deepgramApiKey: "",+ aiModel: "gpt-4",+ aiUrl: "https://api.openai.com/v1",+ customPrompt: "",+ port: 3030,+ dataDir: "default",+ disableAudio: false,+ ignoredWindows: [],+ includedWindows: [],+ aiProviderType: "openai",+ embeddedLLM: {+ enabled: false,+ model: "llama3.2:1b-instruct-q4_K_M",+ port: 11438,+ },+ enableFrameCache: true,+ enableUiMonitoring: false,+ aiMaxContextChars: 128000,+ };++ const [settings, setSettings] = useState<Settings>(defaultSettings);+ const [loading, setLoading] = useState(false);+ const [error, setError] = useState<Error | null>(null);++ useEffect(() => {+ const loadSettings = async () => {+ setLoading(true);+ try {+ const response = await fetch("/api/settings");+ const data = await response.json();+ setSettings({ ...defaultSettings, ...data });+ } catch (err) {+ setError(err as Error);+ } finally {+ setLoading(false);+ }+ };+ loadSettings();+ }, []);++ const updateSetting = async <T extends keyof Settings>(+ key: T,+ value: Settings[T]+ ) => {+ try {+ await fetch("/api/settings", {+ method: "PUT",+ body: JSON.stringify({ key, value }),+ });+ setSettings((prev) => ({ ...prev, [key]: value }));+ } catch (err) {+ setError(err as Error);+ }+ };++ const updateSettings = async (newSettings: Partial<Settings>) => {+ try {+ await fetch("/api/settings", {+ method: "PUT",+ body: JSON.stringify({ value: newSettings, isPartialUpdate: true }),+ });+ setSettings((prev) => ({ ...prev, ...newSettings }));+ } catch (err) {+ setError(err as Error);+ }+ };++ const resetSettings = async (settingKey?: keyof Settings) => {+ try {+ await fetch("/api/settings", {+ method: "PUT",+ body: JSON.stringify({ reset: true, key: settingKey }),+ });+ if (settingKey) {+ setSettings((prev) => ({+ ...prev,+ [settingKey]: defaultSettings[settingKey],+ }));+ } else {+ setSettings(defaultSettings);+ }+ } catch (err) {+ setError(err as Error);+ }+ };++ return {+ settings,+ loading,+ error,+ updateSetting,+ updateSettings,+ resetSettings,+ };+}diff --git a/pipes/data-table/src/lib/hooks/use-sql-autocomplete.tsx b/pipes/data-table/src/lib/hooks/use-sql-autocomplete.tsxnew file mode 100644index 000000000..7db3de855--- /dev/null+++ b/pipes/data-table/src/lib/hooks/use-sql-autocomplete.tsx@@ -0,0 +1,61 @@+import { useState, useEffect, useCallback } from "react";++interface AutocompleteItem {+ name: string;+ count: number;+}++const CACHE_DURATION = 5 * 60 * 1000; // 5 minutes++const cache: Record<string, { data: AutocompleteItem[]; timestamp: number }> =+ {};++export function useSqlAutocomplete(type: "app" | "window") {+ const [items, setItems] = useState<AutocompleteItem[]>([]);+ const [isLoading, setIsLoading] = useState(false);++ const fetchItems = useCallback(async () => {+ setIsLoading(true);+ try {+ const cachedData = cache[type];+ if (cachedData && Date.now() - cachedData.timestamp < CACHE_DURATION) {+ setItems(cachedData.data);+ } else {+ const query = `+ SELECT ${+ type === "app" ? "ocr.app_name" : "ocr.window_name"+ } as name, COUNT(*) as count+ FROM ocr_text ocr+ JOIN frames f ON ocr.frame_id = f.id+ WHERE f.timestamp > datetime('now', '-7 days')+ GROUP BY ${type === "app" ? "ocr.app_name" : "ocr.window_name"}+ ORDER BY count DESC+ LIMIT 100+ `;+ const response = await fetch("http://localhost:3030/raw_sql", {+ method: "POST",+ headers: {+ "Content-Type": "application/json",+ },+ body: JSON.stringify({ query }),+ });+ if (!response.ok) {+ throw new Error(`HTTP error! status: ${response.status}`);+ }+ const result = await response.json();+ setItems(result);+ cache[type] = { data: result, timestamp: Date.now() };+ }+ } catch (error) {+ console.error("failed to fetch items:", error);+ } finally {+ setIsLoading(false);+ }+ }, [type]);++ useEffect(() => {+ fetchItems();+ }, [fetchItems]);++ return { items, isLoading };+}diff --git a/pipes/data-table/src/lib/utils.ts b/pipes/data-table/src/lib/utils.tsnew file mode 100644index 000000000..8bfbf1a0f--- /dev/null+++ b/pipes/data-table/src/lib/utils.ts@@ -0,0 +1,47 @@+import { ContentItem } from "@screenpipe/js";+import { clsx, type ClassValue } from "clsx"+import { twMerge } from "tailwind-merge"+import levenshtein from "js-levenshtein";++export function cn(...inputs: ClassValue[]) {+ return twMerge(clsx(inputs))+}++export const removeDuplicateSelections = (+ results: ContentItem[],+ selectedResults: Set<number>,+ similarityThreshold: number = 0.9+): Set<number> => {+ const newSelectedResults = new Set<number>();+ const seenContents: string[] = [];++ const getSimilarity = (str1: string, str2: string): number => {+ const maxLength = Math.max(str1.length, str2.length);+ const distance = levenshtein(str1, str2);+ return 1 - distance / maxLength;+ };++ const isDuplicate = (content: string): boolean => {+ return seenContents.some(+ (seenContent) =>+ getSimilarity(content, seenContent) >= similarityThreshold+ );+ };++ Array.from(selectedResults).forEach((index) => {+ const item = results[index];+ if (!item || !item.type) return;++ let content = "";+ if (item.type === "OCR") content = item.content.text;+ else if (item.type === "Audio") content = item.content.transcription;+ else if (item.type === "UI") content = item.content.text;++ if (!isDuplicate(content)) {+ seenContents.push(content);+ newSelectedResults.add(index);+ }+ });++ return newSelectedResults;+};diff --git a/pipes/data-table/tailwind.config.ts b/pipes/data-table/tailwind.config.tsnew file mode 100644index 000000000..9a58f7ad4--- /dev/null+++ b/pipes/data-table/tailwind.config.ts@@ -0,0 +1,84 @@+import type { Config } from "tailwindcss";++export default {+ darkMode: ["class"],+ content: [+ "./src/pages/**/*.{js,ts,jsx,tsx,mdx}",+ "./src/components/**/*.{js,ts,jsx,tsx,mdx}",+ "./src/app/**/*.{js,ts,jsx,tsx,mdx}",+ ],+ theme: {+ extend: {+ colors: {+ background: 'hsl(var(--background))',+ foreground: 'hsl(var(--foreground))',+ card: {+ DEFAULT: 'hsl(var(--card))',+ foreground: 'hsl(var(--card-foreground))'+ },+ popover: {+ DEFAULT: 'hsl(var(--popover))',+ foreground: 'hsl(var(--popover-foreground))'+ },+ primary: {+ DEFAULT: 'hsl(var(--primary))',+ foreground: 'hsl(var(--primary-foreground))'+ },+ secondary: {+ DEFAULT: 'hsl(var(--secondary))',+ foreground: 'hsl(var(--secondary-foreground))'+ },+ muted: {+ DEFAULT: 'hsl(var(--muted))',+ foreground: 'hsl(var(--muted-foreground))'+ },+ accent: {+ DEFAULT: 'hsl(var(--accent))',+ foreground: 'hsl(var(--accent-foreground))'+ },+ destructive: {+ DEFAULT: 'hsl(var(--destructive))',+ foreground: 'hsl(var(--destructive-foreground))'+ },+ border: 'hsl(var(--border))',+ input: 'hsl(var(--input))',+ ring: 'hsl(var(--ring))',+ chart: {+ '1': 'hsl(var(--chart-1))',+ '2': 'hsl(var(--chart-2))',+ '3': 'hsl(var(--chart-3))',+ '4': 'hsl(var(--chart-4))',+ '5': 'hsl(var(--chart-5))'+ }+ },+ borderRadius: {+ lg: 'var(--radius)',+ md: 'calc(var(--radius) - 2px)',+ sm: 'calc(var(--radius) - 4px)'+ },+ keyframes: {+ 'accordion-down': {+ from: {+ height: '0'+ },+ to: {+ height: 'var(--radix-accordion-content-height)'+ }+ },+ 'accordion-up': {+ from: {+ height: 'var(--radix-accordion-content-height)'+ },+ to: {+ height: '0'+ }+ }+ },+ animation: {+ 'accordion-down': 'accordion-down 0.2s ease-out',+ 'accordion-up': 'accordion-up 0.2s ease-out'+ }+ }+ },+ plugins: [require("tailwindcss-animate")],+} satisfies Config;diff --git a/pipes/data-table/tsconfig.json b/pipes/data-table/tsconfig.jsonnew file mode 100644index 000000000..c1334095f--- /dev/null+++ b/pipes/data-table/tsconfig.json@@ -0,0 +1,27 @@+{+ "compilerOptions": {+ "target": "ES2017",+ "lib": ["dom", "dom.iterable", "esnext"],+ "allowJs": true,+ "skipLibCheck": true,+ "strict": true,+ "noEmit": true,+ "esModuleInterop": true,+ "module": "esnext",+ "moduleResolution": "bundler",+ "resolveJsonModule": true,+ "isolatedModules": true,+ "jsx": "preserve",+ "incremental": true,+ "plugins": [+ {+ "name": "next"+ }+ ],+ "paths": {+ "@/*": ["./src/*"]+ }+ },+ "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],+ "exclude": ["node_modules"]+}