import type { TerminalLine } from '$lib/components/tui/types';
import { sortedCards, packageProjects, openSourceProjects, researchItems } from '$lib/config';

const totalHackathons = sortedCards.length;
const totalAwards = sortedCards.filter(c => c.awards && c.awards.length > 0).length;
const cardWidth = 'calc((100% - 1.5rem) / 4)';

export const lines: TerminalLine[] = [
    { type: 'command' as const, content: 'ls ~/projects' },
    { type: 'header' as const, content: 'My Project Universe' },
    { type: 'output' as const, content: `(&muted)Everything I build lives in one of four buckets. Pick a door.(&)` },
    { type: 'blank' as const, content: '' },
    { type: 'output' as const, content: `(&muted)Open Source:(&) (&primary)${openSourceProjects.length}(&)   (&muted)Packages:(&) (&orange)${packageProjects.length}(&)   (&muted)Hackathons:(&) (&green)${totalHackathons}(&) (&muted)(${totalAwards} with awards)(&)   (&muted)Research:(&) (&cyan)${researchItems.length}(&)` },
    { type: 'blank' as const, content: '' },
    {
        type: 'card' as const,
        content: '',
        cardTitle: 'Open Source',
        icon: 'mdi:source-branch',
        cardFooter: `${openSourceProjects.length} projects`,
        children: [
            { type: 'output' as const, content: `(&muted)Libraries and tools I build and maintain in the open.(&)` },
            { type: 'button' as const, content: 'Browse Open Source', href: '/projects/opensource', icon: 'mdi:arrow-right', style: 'accent' as const }
        ],
        inline: true,
        display: 'flex' as const,
        cardWidth
    },
    {
        type: 'card' as const,
        content: '',
        cardTitle: 'Packages',
        icon: 'mdi:package-variant',
        cardFooter: `${packageProjects.length} published`,
        children: [
            { type: 'output' as const, content: `(&muted)CLI tools and packages published for others to install.(&)` },
            { type: 'button' as const, content: 'Browse Packages', href: '/projects/packages', icon: 'mdi:arrow-right', style: 'accent' as const }
        ],
        inline: true,
        display: 'flex' as const,
        cardWidth
    },
    {
        type: 'card' as const,
        content: '',
        cardTitle: 'Hackathons',
        icon: 'mdi:trophy',
        cardFooter: `${totalHackathons} events · ${totalAwards} awards`,
        children: [
            { type: 'output' as const, content: `(&muted)Weekend builds, demos, and the awards they picked up.(&)` },
            { type: 'button' as const, content: 'Browse Hackathons', href: '/projects/hackathons', icon: 'mdi:arrow-right', style: 'accent' as const }
        ],
        inline: true,
        display: 'flex' as const,
        cardWidth
    },
    {
        type: 'card' as const,
        content: '',
        cardTitle: 'Research',
        icon: 'mdi:microscope',
        cardFooter: `${researchItems.length} items`,
        children: [
            { type: 'output' as const, content: `(&muted)My Research Roles, Projects, and Publications.(&)` },
            { type: 'button' as const, content: 'Browse Research', href: '/projects/research', icon: 'mdi:arrow-right', style: 'accent' as const }
        ],
        inline: true,
        display: 'flex' as const,
        cardWidth
    },
];
