import type { CSSProperties } from 'react' import type { LucideIcon } from 'lucide-react' import { AlignJustify, Archive, CheckCircle2, ChevronDown, Code2, FileText, GitBranch, Inbox, Plus, Search, Settings, SlidersHorizontal, Sparkles, Star, Trash2, } from 'lucide-react' import { cn } from '@/lib/utils' const SIDEBAR_GROUPS = [ { rows: ['62%', '48%', '58%', '52%'], count: '24px' }, { rows: ['72%'], count: '30px' }, { rows: ['34%', '42%', '38%', '56%', '50%', '44%', '39%', '46%'], count: '26px' }, { rows: ['38%', '52%', '32%'] }, ] const NOTE_ROWS = [ { selected: false, title: '68%', snippet: '84%', chips: ['56px'] }, { selected: true, title: '62%', snippet: '78%', chips: ['64px', '54px', '72px'] }, { selected: false, title: '48%', snippet: '44%', chips: [] }, { selected: false, title: '82%', snippet: '74%', chips: ['68px'] }, { selected: false, title: '70%', snippet: '88%', chips: ['76px', '92px'] }, { selected: false, title: '58%', snippet: '66%', chips: ['64px'] }, { selected: false, title: '76%', snippet: '72%', chips: ['72px'] }, ] const EDITOR_ACTIONS = [Star, CheckCircle2, GitBranch, Code2, AlignJustify, Sparkles, Archive, Trash2, SlidersHorizontal] const STATUS_LEFT = ['70px', '104px', '88px', '116px', '82px'] const STATUS_RIGHT = ['44px', '78px', '18px', '18px'] type AppLoadingSkeletonProps = { noteListWidth?: number showNoteList?: boolean showSidebar?: boolean sidebarWidth?: number } function SkeletonBar({ className, style }: { className?: string; style?: CSSProperties }) { return (
) } function SkeletonIcon({ icon: Icon, active = false }: { icon: LucideIcon; active?: boolean }) { return ( ) } function SidebarRow({ icon, width, active = false, countWidth }: { icon: LucideIcon width: string active?: boolean countWidth?: string }) { return (
{countWidth && }
) } function SidebarSkeletonGlyph() { return } function SidebarStubRow({ width, countWidth }: { width: string countWidth?: string }) { return (
{countWidth && }
) } function SidebarGroupSkeleton({ rows, count }: { rows: string[]; count?: string }) { return (
{count && }
{rows.map((width, index) => ( 3 ? '30px' : undefined} /> ))}
) } function SidebarSkeleton() { return ( ) } function NoteRowSkeleton({ selected, title, snippet, chips }: { selected: boolean title: string snippet: string chips: string[] }) { return (
{chips.length > 0 && (
{chips.map((width) => ( ))}
)}
) } function NoteListSkeleton() { return (
{NOTE_ROWS.map((row, index) => ( ))}
) } function EditorSkeleton() { return (
{EDITOR_ACTIONS.map((Icon, index) => ( ))}
{[0, 1, 2].map((index) => (
))}
) } function StatusSkeleton() { return (
{STATUS_LEFT.map((width, index) => ( ))}
{STATUS_RIGHT.map((width, index) => ( ))}
) } export function AppLoadingSkeleton({ noteListWidth = 350, showNoteList = true, showSidebar = true, sidebarWidth = 250, }: AppLoadingSkeletonProps) { return (
Loading vault