package seedu.todo.controllers.concerns;

import seedu.todo.models.TodoListDB;
import seedu.todo.ui.UiManager;
import seedu.todo.ui.views.ConfigView;
import seedu.todo.ui.views.IndexView;

/**
 * Class to store rendering methods to be shared across controllers.
 * 
 * @author louietyj
 *
 */
public class Renderer {
    
    /**
     * Renders the indexView.
     * 
     * @param db
     * @param consoleMessage to be rendered in console, leave null if not needed
     */
    public static void renderIndex(TodoListDB db, String consoleMessage) {
        IndexView view = UiManager.loadView(IndexView.class);
        view.tasks = db.getAllTasks();
        view.events = db.getAllEvents();
        UiManager.renderView(view);
        
        if (consoleMessage != null) {
            UiManager.updateConsoleMessage(consoleMessage);
        }
    }
    
    /**
     * Renders the ConfigView.
     * 
     * @param consoleMessage to be rendered in console, leave null if not needed
     */
    public static void renderConfig(String consoleMessage) {
        ConfigView view = UiManager.loadView(ConfigView.class);
        UiManager.renderView(view);
        
        if (consoleMessage != null) {
            UiManager.updateConsoleMessage(consoleMessage);
        }
    }

}

@@ -315,32 +315,716 @@
  %7B%0A    %0A    /**%0A
+     * Renders an error message in both the console and the input field, leave null or empty string if not needed.%0A     * %0A     * @param consoleMessage       Message to be rendered in the console%0A     * @param consoleInputValue    Value to display in the input field%0A     */%0A    public static void showConsoleError(String consoleMessage, String consoleInputValue) %7B%0A        if (consoleMessage != null && consoleMessage.length() %3E 0) %7B%0A            UiManager.updateConsoleMessage(consoleMessage);%0A        %7D%0A        %0A        if (consoleInputValue != null && consoleInputValue.length() %3E 0) %7B%0A            UiManager.updateConsoleInputValue(consoleInputValue);%0A        %7D%0A    %7D%0A    %0A    /**%0A
      * Renders t

Add Renderer.showConsoleError