import { FaExternalLinkAlt, FaGithub } from 'react-icons/fa';
import { StyledCursor } from '../components/styles/Cursor.styled';
import { StyledProjects } from '../components/styles/Projects.styled';
import { StyledSectionHeader } from '../components/styles/SectionHeader.styled';

const badges = {
  HTML: ' https://img.shields.io/badge/HTML5-E34F26?style=for-the-badge&logo=html5&logoColor=white',
  CSS: ' https://img.shields.io/badge/CSS3-1572B6?style=for-the-badge&logo=css3&logoColor=white',
  JS: ' https://img.shields.io/badge/JavaScript-323330?style=for-the-badge&logo=javascript&logoColor=F7DF1E',
  SASS: ' https://img.shields.io/badge/Sass-CC6699?style=for-the-badge&logo=sass&logoColor=white',
  TS: ' https://img.shields.io/badge/TypeScript-007ACC?style=for-the-badge&logo=typescript&logoColor=white',
  Node: ' https://img.shields.io/badge/Node.js-43853D?style=for-the-badge&logo=node.js&logoColor=white',
  Vue: ' https://img.shields.io/badge/Vue.js-35495E?style=for-the-badge&logo=vue.js&logoColor=4FC08D',
  Express: ' https://img.shields.io/badge/Express.js-404D59?style=for-the-badge',
  Mongo: ' https://img.shields.io/badge/MongoDB-4EA94B?style=for-the-badge&logo=mongodb&logoColor=white',
  React: ' https://img.shields.io/badge/React-20232A?style=for-the-badge&logo=react&logoColor=61DAFB',
  Flutter: ' https://img.shields.io/badge/Flutter-02569B?style=for-the-badge&logo=flutter&logoColor=white',
  NET: ' https://img.shields.io/badge/.NET-5C2D91?style=for-the-badge&logo=.net&logoColor=white',
  Python: ' https://img.shields.io/badge/Python-3776AB?style=for-the-badge&logo=python&logoColor=white',
  Java: ' https://img.shields.io/badge/Java-ED8B00?style=for-the-badge&logo=java&logoColor=white',
  AWS: ' https://img.shields.io/badge/Amazon_AWS-232F3E?style=for-the-badge&logo=amazon-aws&logoColor=white',
  Heroku: ' https://img.shields.io/badge/Heroku-430098?style=for-the-badge&logo=heroku&logoColor=white',
  NestJS: 'https://img.shields.io/badge/nestjs-red?style=for-the-badge&logo=nestjs&logoColor=white',
  Discord: ' https://img.shields.io/badge/discord.js-white?style=for-the-badge&logo=discord&logoColor=blue',
  Postgresql: ' https://img.shields.io/badge/postgresql-blue?style=for-the-badge&logo=postgresql&logoColor=white',
  CSharp: ' https://img.shields.io/badge/C%20SHARP-orange?style=for-the-badge&logo=csharp&logoColor=white',
  Dotnet: ' https://img.shields.io/badge/.NET-5C2D91?style=for-the-badge&logo=.net&logoColor=white',
};

const projects = {
  showcase: [
    {
      thumbnailSrc: 'stacjownik-1.png',
      iconSrc: 'stacjownik-logo.svg',
      title: 'Stacjownik',
      subtitle: '',
      desc: "A tool made for the Polish railway simulator: Train Driver 2.\
      It collects all the available data sent over API from the game, processes it and shows it on the page in a convenient form.\
      User can browse online players, as well as search for their history and past activities. The app\
      uses dedicated Stacjownik API which is collecting and serving game data on the backend. It's available in two languages: Polish and English.",
      technologies: [badges.Vue, badges.TS, badges.SASS],
      repoLink: 'https://github.com/Spythere/stacjownik',
      siteLink: 'https://stacjownik-td2.web.app/',
    },
    {
      thumbnailSrc: 'pojazdownik-1.png',
      iconSrc: 'pojazdownik-logo.svg',
      title: 'Pojazdownik',
      subtitle: '',
      desc: "Another tool made for the Train Driver 2 community, which allows players to easily create their own railway rolling stock configurations.\
      Its main features consist of uploading & downloading created rolling stock, drawing a real train number (according to Polish railways regulations)\
      and generating a freight train composition with specified cargo. It's available in two languages: Polish and English.",
      technologies: [badges.Vue, badges.TS, badges.SASS],
      repoLink: 'https://github.com/Spythere/pojazdownik',
      siteLink: 'https://pojazdownik-td2.web.app/',
    },
    {
      thumbnailSrc: 'generator-1.png',
      iconSrc: 'generator-logo.svg',
      title: 'GeneraTOR',
      subtitle: '',
      desc: 'The last of the "Holy Trinity" of applications created for the TD2 simulator. It\'s a graphical interface of so-called "written orders"\
      (which are used in railway traffic to conduct trains in case of emergency). The app is fully interactive and beginner-friendly.\
      It\'s available in native (Polish) language only due to the nature of the written  orders which are exclusively used in Polish railway system.',
      technologies: [badges.Vue, badges.TS, badges.SASS],
      repoLink: 'https://github.com/Spythere/genera-tor',
      siteLink: 'https://generator-td2.web.app/',
    },
    {
      thumbnailSrc: 'stacjownik-manager-1.png',
      iconSrc: 'stacjownik-dev-logo.svg',
      title: 'Stacjownik Manager',
      subtitle: '',
      desc: "An additional tool made for people who work with Stacjownik and update it with the freshest data coming from the simulator which isn't automatically scraped, mainly new sceneries (maps available for the community).\
      It's connected with dedicated API where all the changes are processed and updated. The manager is protected with a simple authentication system\
      that prevents unauthorized people from accessing and using the site. Available entirely in Polish for practical reasons.",
      technologies: [badges.Vue, badges.TS, badges.SASS],
      repoLink: 'https://github.com/Spythere/station-manager-2.0',
      siteLink: 'https://station-manager.web.app/',
    },
  ],
  other: [
    {
      title: 'Stacjownik Backend + API',
      iconSrc: null,
      subtitle: '',
      desc: 'The backend services for Stacjownik site. Here I compute all data which is further sent to the app. Aside from the API,\
      it\'s also used for storing history data about users which can be later browsed in the "Journal" tab. ',
      technologies: [badges.NestJS, badges.TS, badges.Postgresql],
      repoLink: 'https://github.com/Spythere/station-manager-2.0',
      docsLink: 'https://stacjownik.spythere.eu/docs',
    },
    {
      title: 'Stacjobot',
      iconSrc: null,
      subtitle: '',
      desc: 'The backend services for Stacjownik site. Here I compute all data which is further sent to the app. Aside from the API,\
      it\'s also used for storing history data about users which can be later browsed in the "Journal" tab. ',
      technologies: [badges.NestJS, badges.Discord, badges.TS],
      repoLink: 'https://github.com/Spythere/station-manager-2.0',
    },
    {
      title: 'TD2 Discord Presence',
      iconSrc: null,
      subtitle: '',
      desc: 'The backend services for Stacjownik site. Here I compute all data which is further sent to the app. Aside from the API,\
      it\'s also used for storing history data about users which can be later browsed in the "Journal" tab. ',
      technologies: [badges.CSharp, badges.Dotnet],
      repoLink: 'https://github.com/Spythere/station-manager-2.0',
    },
  ],
};

function ProjectsSection() {
  return (
    <StyledProjects id="projects">
      <StyledSectionHeader>
        MY{' '}
        <span className="text--accent" style={{ position: 'relative' }}>
          PROJECTS
          <StyledCursor />
        </span>
      </StyledSectionHeader>

      <h3 className="sub-header">SHOWCASE - MAJOR PROJECTS</h3>

      <div className="showcase-container">
        {projects.showcase.map((p) => (
          <div className="project-card showcase">
            <div className="project-thumbnail">
              <img src={p.thumbnailSrc} alt="" />
            </div>

            <div className="project-content">
              <a className="project-title" href={p.siteLink} target="_blank">
                {p.iconSrc && <img className="project-title-icon" src={p.iconSrc} alt="" />}
                <h2 className="project-title-content">{p.title}</h2>
              </a>
              <h3 className="project-subtitle">{p.subtitle}</h3>

              <div className="project-badges">
                {p.technologies.map((tech) => (
                  <img src={tech} alt="technology badge"></img>
                ))}
              </div>

              <hr />

              <p className="project-desc">{p.desc}</p>

              <div className="project-actions">
                <a href={p.repoLink} target="_blank">
                  <FaGithub />
                  SOURCE
                </a>
                <a href={p.siteLink} target="_blank">
                  <FaExternalLinkAlt />
                  LIVE APP
                </a>
              </div>
            </div>
          </div>
        ))}
      </div>

      <h3 className="sub-header">OTHER PROJECTS</h3>

      <div className="other-projects-container">
        {projects.other.map((p) => (
          <div className="project-card">
            <div className="project-content">
              <div className="project-title">
                {p.iconSrc && <img className="project-title-icon" src={p.iconSrc} alt="" />}
                <h2 className="project-title-content">{p.title}</h2>
              </div>
              <h3 className="project-subtitle">{p.subtitle}</h3>

              <div className="project-badges">
                {p.technologies.map((tech) => (
                  <img src={tech} alt="technology badge"></img>
                ))}
              </div>

              <hr />

              <p className="project-desc">{p.desc}</p>

              <div className="project-actions">
                {p.repoLink && (
                  <a href={p.repoLink} target="_blank">
                    <FaGithub />
                    SOURCE
                  </a>
                )}

                {p.docsLink && (
                  <a href={p.docsLink} target="_blank">
                    <FaExternalLinkAlt />
                    DOCS
                  </a>
                )}
              </div>
            </div>
          </div>
        ))}
      </div>
    </StyledProjects>
  );
}

export default ProjectsSection;
