import "./components/ui/tidal.css"; import { useEffect, useRef, useState } from "react"; import { Plus, RotateCcw, Check, X } from "lucide-react"; import { TidalFileUpload, type TidalFileStatus } from "./components/ui/file-upload"; import "./components/ui/file-upload.css"; const tidalExampleStyles = ".tidal-scope .file-upload-specimen{width:100%;max-width:580px;padding:28px;border:1px solid var(--t-border);border-radius:var(--t-radius-card);background:var(--t-subtle);color:var(--t-ink);box-shadow:0 22px 44px -32px #00000038}.tidal-scope .file-upload-demo-tools{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-top:18px}.tidal-scope .file-upload-demo-tools>button,.tidal-scope .file-upload-demo-prepare{display:inline-flex;align-items:center;justify-content:center;gap:7px;min-width:44px;min-height:44px;padding:9px 12px;border:1px solid var(--t-border);border-radius:var(--t-radius-control);background:var(--t-surface);color:var(--t-ink);font:inherit;font-size:11px;cursor:pointer;transition:background 140ms,transform 140ms var(--t-ease-out)}.tidal-scope .file-upload-demo-tools>button:hover{background:var(--t-wash)}.tidal-scope .file-upload-demo-tools>button:active,.tidal-scope .file-upload-demo-prepare:active:not(:disabled){transform:scale(.98)}.tidal-scope .file-upload-demo-prepare{width:100%;margin-top:10px;background:var(--t-ink);color:var(--t-surface);border-color:var(--t-ink)}.tidal-scope .file-upload-demo-prepare:focus-visible{outline:3px solid currentColor;outline-offset:-5px}.tidal-scope .file-upload-demo-prepare:disabled{opacity:.5;cursor:not-allowed}.tidal-scope .file-upload-demo-note{font-size:11px;line-height:1.6;color:var(--t-muted);margin:15px 0 0}\n@media(max-width:480px){.tidal-scope .file-upload-specimen{padding:18px}}@media(prefers-reduced-motion:reduce){.tidal-scope .file-upload-demo-tools>button:active,.tidal-scope .file-upload-demo-prepare:active:not(:disabled){transform:none}}"; export function FileUploadDemo(){ const [files,setFiles]=useState([]),[states,setStates]=useState>(new Map()),[running,setRunning]=useState(false),[revision,setRevision]=useState(0); const timer=useRef|undefined>(undefined),progress=useRef(0); useEffect(()=>()=>clearTimeout(timer.current),[]); function cancel(){clearTimeout(timer.current);setRunning(false);setStates(current=>new Map([...current].filter(([,state])=>state.state!=="uploading")));} function change(next:File[]){cancel();setFiles(next);setStates(current=>new Map([...current].filter(([file])=>next.includes(file))));} function samples(){cancel();setStates(new Map());setFiles([new File(["Project overview\n".repeat(64)],"Project brief.txt",{type:"text/plain"}),new File(["# Launch checklist\n".repeat(48)],"Launch checklist.md",{type:"text/markdown"})]);} function reset(){cancel();setFiles([]);setStates(new Map());setRevision(n=>n+1);} function prepare(){if(running||!files.length)return;progress.current=0;setRunning(true);setStates(new Map(files.map(f=>[f,{state:"uploading",progress:0,label:"Preparing sample"}])));const step=()=>{progress.current=Math.min(100,progress.current+20);setStates(new Map(files.map(f=>[f,{state:progress.current===100?"complete":"uploading",progress:progress.current,label:progress.current===100?"Sample ready":"Preparing sample"}])));if(progress.current<100)timer.current=setTimeout(step,160);else setRunning(false);};timer.current=setTimeout(step,160);} return

Local files and preparation. Nothing is uploaded.

; } export default function AgentExample() { return (
); }