package com.realnet.OpenAi.Renders;

import java.util.Arrays;
import java.util.List;
import java.util.Map;
public class FeatureSectionRenderer {

    @SuppressWarnings("unchecked")
    public static String render(Map<String, Object> json) {
        StringBuilder sb = new StringBuilder();
        sb.append("<div class='feature-section'>");

        sb.append("<img src='' alt='Feature Image'/>");

        sb.append("<div class='feature-content'><ul>");

        Object rawList = json.get("features");
        if (rawList instanceof List) {
            List<Object> features = (List<Object>) rawList;
            for (Object f : features) {
                sb.append("<li>").append(f.toString()).append("</li>");
            }
        }

        sb.append("</ul></div></div>");
        return sb.toString();
    }
}
