'use client'; import Image from "next/image"; import Link from 'next/link'; import TemplateSelector from '@/modals/template-selector'; import { useDesignStore } from '@/stores/design-store'; import { useTemplateStore } from '@/stores/template-store'; // import { PlusIcon, MagnifyingGlassIcon, Bars3Icon, Squares2X2Icon, FolderIcon, ClockIcon, EllipsisHorizontalIcon, ShareIcon, TrashIcon, ArrowUpOnSquareIcon, DocumentPlusIcon, UserGroupIcon } from "@heroicons/react/24/outline"; import { Plus, Search, AlignJustify, // For list view LayoutGrid, // For grid view Folder as FolderIcon, // Alias to avoid conflict if 'Folder' component is used elsewhere Clock, MoreHorizontal, Share2, Trash2, UploadCloud, FilePlus2, FileText, // Generic icon for design cards FileEdit, // Added for designs with uncommitted changes // HelpCircle, // Removed as FAB was removed Github, Bell, // For notifications Settings as SettingsIcon, // For settings BookOpenText, // For Docs ChevronDown, // For dropdowns Shapes, GitPullRequest, // Added for Create PR button HelpCircle, // Added for Help and Feedback LogOut, // Added for Log out Info, // Added for the top banner FileJson, // Added for JSON schema files ServerIcon, Network, // For Domain type designs Workflow, // For Flow type designs FolderInput } from 'lucide-react'; import { Panel, PanelGroup, PanelResizeHandle } from "react-resizable-panels"; import { useState } from 'react'; export default function Page() { const { designs } = useDesignStore(); const { setShowTemplateSelector } = useTemplateStore(); // Sidebar main navigation item const workspaceSections = [ { id: 1, name: "My Designs", count: designs.length, active: true, icon: FolderIcon }, ]; const githubRepos = [ { id: 'repo1', name: "eventcatalog/eventcatalog", icon: Github }, { id: 'repo2', name: "your-org/design-system", icon: Github }, { id: 'repo3', name: "personal/new-project-x", icon: Github }, ]; // View and Search States type ViewMode = 'list' | 'grid'; const [currentView, setCurrentView] = useState('grid'); const [searchTerm, setSearchTerm] = useState(''); // Filtered Designs const filteredDesigns = designs.filter(design => { const term = searchTerm.toLowerCase(); const typeMatch = design.type.toLowerCase().includes(term); const nameMatch = design.name.toLowerCase().includes(term); const descriptionMatch = design.description?.toLowerCase().includes(term) || false; const domainMatch = design.domainName?.toLowerCase().includes(term) || false; const eventNameMatch = design.eventName?.toLowerCase().includes(term) || false; const formatMatch = design.format?.toLowerCase().includes(term) || false; return typeMatch || nameMatch || descriptionMatch || domainMatch || eventNameMatch || formatMatch; }); return (
{/* Preview Banner */}
EventCatalog Studio is in public preview. By continuing to use EventCatalog Studio, you agree to the{' '} preview terms .
{/* Global Header */}
{/* Or a more generic app icon like 'Layers' or 'Box' */} EventCatalog Studio
Docs Settings
DS

Workspace

{workspaceSections.map((folder) => { const IconComponent = folder.icon; return (
{folder.name}
{folder.count > 0 && ( {folder.count} )} {folder.active && }
); })}

Repositories

{githubRepos.map((repo) => ( {repo.name} ))}
Help and Feedback
Log out
{/* Main Content Header: Search, View Options, New Button */}
setSearchTerm(e.target.value)} />
{/* Content Listing Area */}
{filteredDesigns.length > 0 ? (
{filteredDesigns.map((design) => { const DesignIcon = FolderInput const iconColorClass = design.hasUncommittedChanges ? 'bg-amber-500' : design.type === "Service" ? 'bg-pink-500' : design.type === "Flow" ? 'bg-teal-500' : design.type === "Domain" ? 'bg-rose-500' : 'bg-slate-500'; if (currentView === 'list') { return (

{design.name}

({design.type})
{design.type === "Service" &&

{design.description} (Domain: {design.domainName})

} {design.type === "Flow" &&

{design.description}

} {design.type === "Domain" &&

{design.description}

}
{design.lastModified}
{design.hasUncommittedChanges && (
)}
); } else { // Grid View return (

{design.name}

{design.type}

{design.type === "Service" &&

Domain: {design.domainName}

} {design.type === "Flow" &&

{/* Description might be too long for grid, consider summary or removing */}

} {design.type === "Domain" &&

{/* Description might be too long for grid, consider summary or removing */}

}

{design.description}

Edited {design.lastModified}
{design.hasUncommittedChanges && (
)}
); } })}
) : (

No designs yet

Get started by creating a new design, or try a different search term.

)}
{/* Floating Action Button (Optional) - REMOVING THIS */}
); }