import type { CompetitionItem, CompetitionPanelContent, CompetitionTab, CompetitionTabsContent } from "./types";

export const MONTH_TIMELINE = [
    "August",
    "September",
    "October",
    "November",
    "December",
    "January",
    "February",
    "March",
    "April",
    "May",
    "June",
] as const;

export const emptyCompetitionItem = (): CompetitionItem => ({
    title: "New competition",
    icon: "🏆",
    iconImage: "",
    category: "",
    color: "deep-sea",
    month: "September",
    description: "",
    publicCompetition: "",
    publicTiming: "",
    orionMonth: "",
    dateTime: "",
    method: "",
    badge: "",
    buttonText: "",
    buttonUrl: "",
});

export const defaultOrionCompetitions: CompetitionItem[] = [
    {
        title: "Creative Writing Contest",
        icon: "✍️",
        iconImage: "",
        category: "Writing & Literature",
        color: "deep-sea",
        month: "November",
        description: "",
        publicCompetition: "Scholastic Art & Writing Awards",
        publicTiming: "December–January",
        orionMonth: "November",
        dateTime: "Third Monday of the month",
        method: "Submission",
        badge: "",
        buttonText: "",
        buttonUrl: "",
    },
    {
        title: "Environment Awareness Video",
        icon: "✊",
        iconImage: "",
        category: "Advocacy & Change Makers",
        color: "valencia",
        month: "January",
        description: "",
        publicCompetition: "World of 7 Billion Video Contest",
        publicTiming: "February",
        orionMonth: "January",
        dateTime: "Third Monday of the month",
        method: "Submission",
        badge: "",
        buttonText: "",
        buttonUrl: "",
    },
    {
        title: "Classroom Market Day",
        icon: "🚀",
        iconImage: "",
        category: "STEM Innovation & Entrepreneurship",
        color: "sunflower",
        month: "January",
        description: "",
        publicCompetition: "",
        publicTiming: "",
        orionMonth: "January",
        dateTime: "Third Saturday of the month",
        method: "Saturday (9–1)",
        badge: "",
        buttonText: "",
        buttonUrl: "",
    },
    {
        title: "Arts Competition",
        icon: "🎨",
        iconImage: "",
        category: "Artistic Endeavors",
        color: "valencia",
        month: "February",
        description: "",
        publicCompetition:
            "Congressional Art Competition, Doodle for Google, or International Children's Painting Competition",
        publicTiming: "Spring",
        orionMonth: "February",
        dateTime: "Third Monday of the month",
        method: "Submission",
        badge: "",
        buttonText: "",
        buttonUrl: "",
    },
    {
        title: "Bridge Building Competition",
        icon: "🚀",
        iconImage: "",
        category: "STEM Innovation & Entrepreneurship",
        color: "sunflower",
        month: "March",
        description: "",
        publicCompetition: "West Point Bridge Design Contest",
        publicTiming: "May",
        orionMonth: "March",
        dateTime: "Second Thursdays",
        method: "Weekdays After School",
        badge: "",
        buttonText: "",
        buttonUrl: "",
    },
    {
        title: "Future City Project",
        icon: "✊",
        iconImage: "",
        category: "Advocacy & Change Makers",
        color: "valencia",
        month: "May",
        description: "",
        publicCompetition: "Future City Competition",
        publicTiming: "January",
        orionMonth: "May",
        dateTime: "Weekdays (9–12)",
        method: "Weekdays (9–12)",
        badge: "",
        buttonText: "",
        buttonUrl: "",
    },
    {
        title: "Robotics Competition",
        icon: "🚀",
        iconImage: "",
        category: "STEM Innovation & Entrepreneurship",
        color: "sunflower",
        month: "September",
        description: "",
        publicCompetition: "FIRST LEGO League / FIRST LEGO League Jr.",
        publicTiming: "Late Fall–Winter",
        orionMonth: "September",
        dateTime: "Second Thursdays",
        method: "Weekdays After School",
        badge: "",
        buttonText: "",
        buttonUrl: "",
    },
    {
        title: "Math Olympiad Day",
        icon: "🚀",
        iconImage: "",
        category: "STEM Innovation & Entrepreneurship",
        color: "sunflower",
        month: "October",
        description: "",
        publicCompetition: "AMC 8 (Middle School)",
        publicTiming: "November",
        orionMonth: "October",
        dateTime: "Second Thursdays",
        method: "Weekdays After School",
        badge: "",
        buttonText: "",
        buttonUrl: "",
    },
    {
        title: "STEM Fair",
        icon: "🚀",
        iconImage: "",
        category: "STEM Innovation & Entrepreneurship",
        color: "sunflower",
        month: "November",
        description: "",
        publicCompetition: "SIBA STEM Competitions",
        publicTiming: "November",
        orionMonth: "November",
        dateTime: "Second Thursdays",
        method: "Weekdays After School",
        badge: "",
        buttonText: "",
        buttonUrl: "",
    },
    {
        title: "Chess Championship",
        icon: "⚽",
        iconImage: "",
        category: "Sports",
        color: "mist",
        month: "December",
        description: "",
        publicCompetition: "U.S. Chess Federation Tournaments",
        publicTiming: "Year-round",
        orionMonth: "December",
        dateTime: "Second Thursdays",
        method: "After School Club Time",
        badge: "",
        buttonText: "",
        buttonUrl: "",
    },
];

/** Public-tab defaults aligned with brandscape: season/ongoing items + flexible cards. */
export const defaultPublicCompetitions: CompetitionItem[] = [
    {
        title: "TREP$",
        icon: "🌟",
        iconImage: "",
        category: "Thrive & Lead",
        color: "moss",
        month: "",
        description:
            "A project-based learning program that teaches kids how to start their own businesses in a fun, experiential way. They often hold fairs and competitions.",
        publicCompetition: "",
        publicTiming: "Varies",
        orionMonth: "",
        dateTime: "",
        method: "",
        badge: "",
        buttonText: "",
        buttonUrl: "",
    },
    {
        title: "TiE Young Entrepreneurs (TYE)",
        icon: "🌟",
        iconImage: "",
        category: "Thrive & Lead",
        color: "moss",
        month: "",
        description:
            "A global program fostering future generations of entrepreneurs. Students learn business basics and teamwork, culminating in business plan competitions.",
        publicCompetition: "",
        publicTiming: "Spring",
        orionMonth: "",
        dateTime: "",
        method: "",
        badge: "",
        buttonText: "",
        buttonUrl: "",
    },
    {
        title: "National Youth Entrepreneurship Challenge",
        icon: "🚀",
        iconImage: "",
        category: "STEM Innovation & Entrepreneurship",
        color: "sunflower",
        month: "",
        description: "Offered by NFTE for students who have completed one of their programs.",
        publicCompetition: "",
        publicTiming: "Fall",
        orionMonth: "",
        dateTime: "",
        method: "",
        badge: "",
        buttonText: "",
        buttonUrl: "",
    },
    {
        title: "Biz Kid$ Business Plan Competition",
        icon: "🚀",
        iconImage: "",
        category: "STEM Innovation & Entrepreneurship",
        color: "sunflower",
        month: "",
        description: "Submit business plans for a chance to win money to support your business idea.",
        publicCompetition: "",
        publicTiming: "Fall",
        orionMonth: "",
        dateTime: "",
        method: "",
        badge: "",
        buttonText: "",
        buttonUrl: "",
    },
    {
        title: "Innovation Convention",
        icon: "🌟",
        iconImage: "",
        category: "Thrive & Lead",
        color: "moss",
        month: "",
        description: "Entrepreneurship contests",
        publicCompetition: "",
        publicTiming: "",
        orionMonth: "",
        dateTime: "",
        method: "",
        badge: "",
        buttonText: "",
        buttonUrl: "",
    },
    {
        title: "Family Money Night",
        icon: "🤝",
        iconImage: "",
        category: "Parent Engagement",
        color: "salmon",
        month: "",
        description: "",
        publicCompetition: "",
        publicTiming: "",
        orionMonth: "",
        dateTime: "",
        method: "",
        badge: "",
        buttonText: "",
        buttonUrl: "",
    },
];

export function defaultOrionPanelContent(): CompetitionPanelContent {
    return {
        emoji: "🏫",
        title: "Orion Competitions",
        subtitle: "",
        description: "",
        accentColor: "primary",
        flexibleEmoji: "📌",
        flexibleTitle: "Flexible / Ongoing",
        competitions: defaultOrionCompetitions.map((item) => ({ ...item })),
    };
}

export function defaultPublicPanelContent(): CompetitionPanelContent {
    return {
        emoji: "🌍",
        title: "Public Competitions",
        subtitle: "",
        description: "",
        accentColor: "valencia",
        flexibleEmoji: "📌",
        flexibleTitle: "Flexible / Ongoing",
        competitions: defaultPublicCompetitions.map((item) => ({ ...item })),
    };
}

export function defaultCompetitionTabs(): CompetitionTab[] {
    return [
        {
            id: "orion",
            label: "Orion Competitions",
            icon: "🏫",
            panel: defaultOrionPanelContent(),
        },
        {
            id: "public",
            label: "Public Competitions",
            icon: "🌍",
            panel: defaultPublicPanelContent(),
        },
    ];
}

export function defaultCompetitionTabsContent(): CompetitionTabsContent {
    return {
        defaultTabId: "orion",
        showCounts: true,
        tabs: defaultCompetitionTabs(),
    };
}
