import { createSignal, onMount } from 'solid-js'; import { IconUpload, IconFileText, IconFolder, IconVideo, IconBookmark, IconChecklist, IconNotebook, IconPlus, IconSearch } from '@tabler/icons-solidjs'; interface QuickItem { id: string; name: string; type: 'file' | 'bookmark' | 'task' | 'note' | 'video'; description: string; icon: any; action: string; } export const QuickSelection = () => { const [quickItems, setQuickItems] = createSignal([]); const [searchTerm, setSearchTerm] = createSignal(''); const [selectedCategory, setSelectedCategory] = createSignal('all'); onMount(() => { setQuickItems([ { id: '1', name: 'Upload Document', type: 'file', description: 'Upload a new document to your workspace', icon: IconUpload, action: 'upload' }, { id: '2', name: 'Create Bookmark', type: 'bookmark', description: 'Save a new bookmark', icon: IconBookmark, action: 'create' }, { id: '3', name: 'Add Task', type: 'task', description: 'Create a new task', icon: IconChecklist, action: 'create' }, { id: '4', name: 'Write Note', type: 'note', description: 'Create a new note', icon: IconNotebook, action: 'create' }, { id: '5', name: 'Import YouTube', type: 'video', description: 'Import a YouTube video', icon: IconVideo, action: 'import' }, { id: '6', name: 'Browse Files', type: 'file', description: 'Browse existing files', icon: IconFolder, action: 'browse' }, { id: '7', name: 'Quick Upload', type: 'file', description: 'Quick upload with drag & drop', icon: IconUpload, action: 'quick-upload' }, { id: '8', name: 'Recent Files', type: 'file', description: 'View recently uploaded files', icon: IconFileText, action: 'recent' } ]); }); const filteredItems = () => { return quickItems().filter(item => { const matchesSearch = item.name.toLowerCase().includes(searchTerm().toLowerCase()) || item.description.toLowerCase().includes(searchTerm().toLowerCase()); const matchesCategory = selectedCategory() === 'all' || item.type === selectedCategory(); return matchesSearch && matchesCategory; }); }; const handleAction = (action: string) => { console.log(`Action: ${action}`); // Handle different actions based on the type switch (action) { case 'upload': // Trigger file upload break; case 'create': // Create new item break; case 'import': // Import from external source break; case 'browse': // Navigate to files break; case 'quick-upload': // Quick upload modal break; case 'recent': // Show recent files break; default: break; } }; const categories = [ { value: 'all', label: 'All Items' }, { value: 'file', label: 'Files' }, { value: 'bookmark', label: 'Bookmarks' }, { value: 'task', label: 'Tasks' }, { value: 'note', label: 'Notes' }, { value: 'video', label: 'Videos' } ]; return (

Quick Selection

{/* Search and Filter */}
setSearchTerm(e.currentTarget.value)} class="flex h-10 w-full rounded-md border border-input bg-background pl-10 pr-3 py-2 text-sm text-foreground focus-visible:outline-none focus-visible:ring-1.5 focus-visible:ring-ring" />
{/* Quick Actions Grid */}
{filteredItems().map((item) => { const Icon = item.icon; return (
handleAction(item.action)} >

{item.name}

{item.type}

{item.description}

); })}
{/* Custom Upload Section */}

Custom Upload

Drag & Drop Files

Or click to select files from your computer

Supported Formats:

{['PDF', 'DOC', 'DOCX', 'PPT', 'PPTX', 'TXT', 'MD', 'JPG', 'PNG', 'GIF'].map(format => ( {format} ))}
{/* Recent Activity */}

Recent Quick Actions

Document uploaded

presentation.pptx

2 minutes ago

Bookmark created

SolidJS Documentation

15 minutes ago

Note created

Project Notes

1 hour ago
); };