package com.example.Portfolio.Controllers;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

import com.example.Portfolio.DTO.Link;
import com.example.Portfolio.Services.ProjectService;

@Controller
public class ProjectController {

    @Autowired
    ProjectService projectService;

    @GetMapping("/project/{repo}")
    public String projectPage(@PathVariable String repo, Model model) {

        //navbar links
        model.addAttribute("links", List.of(
            new Link("Overview", "#project-overview"),
            new Link("Demo-Vid", "#demo-vid")
        ));

        model.addAttribute("project", projectService.getProject(repo));

        return "project";
    }
}
