package handlers

import (
	"net/http"

	"github.com/gin-gonic/gin"
)

type paginatedResponse struct {
	Items any `json:"items"`
	Meta  struct {
		Total int `json:"total"`
		Page  int `json:"page"`
		Limit int `json:"limit"`
	} `json:"meta"`
}

func respondPaginated(c *gin.Context, items any, total int, page int, limit int) {
	var resp paginatedResponse
	resp.Items = items
	resp.Meta.Total = total
	resp.Meta.Page = page
	resp.Meta.Limit = limit
	c.JSON(http.StatusOK, resp)
}
