package controllers

import (
	"path/filepath"

	"github.com/gofiber/fiber/v2"
)

type PrivateController struct {
	spaDir string
}

func NewPrivateController(spaDir string) *PrivateController {
	return &PrivateController{spaDir: spaDir}
}

func (ac *PrivateController) Dashboard(c *fiber.Ctx) error {
	return c.SendFile(filepath.Join(ac.spaDir, "index.html"))
}

func (ac *PrivateController) Fallback(c *fiber.Ctx) error {
	return c.SendFile(filepath.Join(ac.spaDir, "index.html"))
}

func (ac *PrivateController) Favicon(c *fiber.Ctx) error {
	return c.SendFile(filepath.Join(ac.spaDir, "favicon.ico"))
}
