44 lines
1.4 KiB
C#
44 lines
1.4 KiB
C#
using Microsoft.AspNetCore.Mvc;
|
|
using System.Collections.Generic;
|
|
|
|
namespace Convert_It_Online.Controllers
|
|
{
|
|
// ViewModel para representar uma ferramenta no menu da Home
|
|
public class ToolViewModel
|
|
{
|
|
public required string TitleKey { get; set; }
|
|
public required string DescriptionKey { get; set; }
|
|
public required string Area { get; set; }
|
|
public required string Controller { get; set; }
|
|
public required string IconClass { get; set; } // Propriedade para o ícone
|
|
public string Action { get; set; } = "Index";
|
|
}
|
|
|
|
public class HomeController : Controller
|
|
{
|
|
public IActionResult Index()
|
|
{
|
|
var availableTools = new List<ToolViewModel>
|
|
{
|
|
new ToolViewModel
|
|
{
|
|
TitleKey = "TextToolsTitle",
|
|
DescriptionKey = "TextToolsDescription",
|
|
Area = "TextTools",
|
|
Controller = "CaseConverter",
|
|
IconClass = "bi-fonts"
|
|
},
|
|
new ToolViewModel
|
|
{
|
|
TitleKey = "ImageToolsTitle",
|
|
DescriptionKey = "ImageToolsDescription",
|
|
Area = "ImageConverters",
|
|
Controller = "JpgToWebp",
|
|
IconClass = "bi-image-alt"
|
|
}
|
|
};
|
|
|
|
return View(availableTools);
|
|
}
|
|
}
|
|
} |