/*
 * Project: Video Sharing Platform
 * Year: 2026
 * Developed by: Molla Samser (Founder of RSK World)
 * 
 * Comments and social interaction logic.
 */

package main

import (
	"net/http"

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

var videoComments = make(map[int][]Comment)

func AddComment(c *gin.Context) {
	var comment Comment
	if err := c.ShouldBindJSON(&comment); err != nil {
		c.JSON(http.StatusBadRequest, gin.H{"error": err.Error()})
		return
	}

	videoComments[comment.VideoID] = append(videoComments[comment.VideoID], comment)
	c.JSON(http.StatusCreated, gin.H{"status": "success", "comment": comment})
}

func GetComments(c *gin.Context) {
	// Logic to fetch comments for a specific video
	c.JSON(http.StatusOK, gin.H{"comments": videoComments})
}
