import type { Dialog } from "@/lib/tinyvn";
import { getRelativeLocaleUrl } from "astro:i18n";
import fedoraWorkstation from "@/assets/imgs/fedora42_workstation.avif";
import fedoraWorkstationPng from "@/assets/imgs/fedora42_workstation.png";
import fedoraPlasma from "@/assets/imgs/fedora42_kdeplasma.avif";
import fedoraPlasmaPng from "@/assets/imgs/fedora42_kdeplasma.png";

const fedoraDialogs: Dialog[] = [
    {
        title: "So you've chosen Fedora.",
        content:
            "Do you have an NVIDIA graphics card?",
        choices: [
            {
                text: "Yes",
                action: "continue"
            },
            {
                text: "No",
                action: "jump",
                data: 5,
            },
        ],
    }, // 0
    {
        title: "Regarding NVIDIA drivers",
        content: `It is recommended for beginners to install Fedora derivatives instead 
as it will help ease the process of setting drivers up. Do you wish to continue with Fedora?`,
        choices: [
            {
                action: "continue",
                text: "I'll go with the easier route"
            },
            {
                action: "jump",
                text: "I'll continue with Fedora",
                data: 5
            }
        ]
    }, // 1
    {
        title: "Do you need Secure Boot?",
        content: `Secure Boot is a technology required by some anticheat programs, 
namely Riot Vanguard.`,
        choices: [
            {
                action: "continue",
                text: "Yes."
            },
            {
                action: "jump",
                text: "No.",
                data: 4
            }
        ]
    }, // 2
    {
        title: "Bazzite",
        content: "Bazzite is a Linux distribution which is basically designed for gamers.",
        choices: [
            {
                action: "link",
                data: "https://bazzite.gg/",
                text: "Visit Website"
            }
        ]
    }, // 3
    {
        title: "Nobara Linux",
        content: "The Nobara project aims to improve Fedora's user-friendliness.",
        choices: [
            {
                action: "link",
                data: "https://nobaraproject.org/",
                text: "Visit Website"
            }
        ]
    }, // 4
    {
        title: "Prerequisites",
        content: "Please prepare an empty/unused USB flash drive with at least 4GB capacity."
    }, // 5
    {
        title: "Fedora Media Writer",
        content: `It is a program which will help you copy Fedora's installer 
to your USB flash drive. Please download and install the program as usual for 
your platform.
<div class="grid grid-flow-col auto-cols-fr gap-2">
    <a href="https://github.com/FedoraQt/MediaWriter/releases/latest"
        class="button" target="_blank" rel="noopener noreferrer">
        Windows/macOS
    </a>
    <a href="https://flathub.org/apps/details/org.fedoraproject.MediaWriter" 
        class="button" target="_blank" rel="noopener noreferrer">
        Linux
    </a>
</div>`,
        choices: [
            {
                action: "continue",
                text: "Done!"
            }
        ]
    }, // 6
    {
        title: "Choose your flavor",
        content: `Choose a desktop environment, pick whatever you like based on 
appearance. KDE Plasma (Right) may be more familiar for Windows users.`,
        choices: [
            {
                action: "continue",
                text: `<figure>
                    <picture>
                        <source srcset="${fedoraWorkstation.src}" type="image/avif" />
                        <img src="${fedoraWorkstationPng.src}" alt="Fedora Workstation 42" />
                    </picture>
                    <figcaption>Fedora Workstation</figcaption>
                </figure>`
            },
            {
                action: "jump",
                text: `<figure>
                    <picture>
                        <source srcset="${fedoraPlasma.src}" type="image/avif" />
                        <img src="${fedoraPlasmaPng.src}" alt="Fedora KDE Plasma Desktop 42" />
                    </picture>
                    <figcaption>Fedora KDE Plasma Desktop</figcaption>
                </figure>`,
                data: 9
            }
        ]
    }, // 7
    {
        title: "Fedora Workstation",
        content: `<picture>
                    <source srcset="${fedoraWorkstation.src}" type="image/avif" />
                    <img src="${fedoraWorkstationPng.src}" alt="Fedora Workstation 42" />
                </picture>`,
        choices: [
            {
                action: "jump",
                text: "Back",
                data: 7
            },
            {
                action: "link",
                text: "Continue",
                data: getRelativeLocaleUrl("en", "fedora/workstation/0")
            }
        ]
    }, // 8
    {
        title: "Fedora KDE Plasma Desktop",
        content: `<picture>
                    <source srcset="${fedoraPlasma.src}" type="image/avif" />
                    <img src="${fedoraPlasmaPng.src}" alt="Fedora KDE Plasma Desktop 42" />
                </picture>`,
        choices: [
            {
                action: "jump",
                text: "Back",
                data: 7
            },
            {
                action: "link",
                text: "Continue",
                data: getRelativeLocaleUrl("en", "fedora/plasma/0")
            }
        ]
    } // 9
];

export default fedoraDialogs;