NextWks/src/core/ui/app-grid.templ

107 lines
2.7 KiB
Text

package ui
import "fmt"
// AppTile represents an application card on the workspace launcher.
type AppTile struct {
Name string
Description string
URL string
Icon string // Emoji or SVG
Color string // Background color for icon
Status string // "ready", "coming-soon", "beta"
}
// DefaultApps returns the default set of workspace apps.
// These are placeholder tiles until supervisor modules are built.
func DefaultApps() []AppTile {
return []AppTile{
{
Name: "Admin Panel",
Description: "Manage users, groups, and workspace settings",
URL: "/admin",
Icon: "⚙️",
Color: "#1e293b",
Status: "ready",
},
{
Name: "Files",
Description: "Coming soon — File storage and sharing",
URL: "#",
Icon: "📁",
Color: "#1e293b",
Status: "coming-soon",
},
{
Name: "Calendar",
Description: "Coming soon — Schedule and events",
URL: "#",
Icon: "📅",
Color: "#1e293b",
Status: "coming-soon",
},
{
Name: "Mail",
Description: "Coming soon — Email integration",
URL: "#",
Icon: "✉️",
Color: "#1e293b",
Status: "coming-soon",
},
{
Name: "Office",
Description: "Coming soon — Documents and spreadsheets",
URL: "#",
Icon: "📝",
Color: "#1e293b",
Status: "coming-soon",
},
{
Name: "Settings",
Description: "Coming soon — Workspace preferences",
URL: "#",
Icon: "🔧",
Color: "#1e293b",
Status: "coming-soon",
},
}
}
templ AppGrid(apps []AppTile) {
<section>
<h2 style="font-size:1.125rem;font-weight:600;margin-bottom:1rem;">
Applications
</h2>
<div class="app-grid">
for _, app := range apps {
@appCard(app)
}
</div>
</section>
}
templ appCard(app AppTile) {
if app.Status == "coming-soon" {
<a href="#" class="app-card" style="opacity:0.6;cursor:default;" aria-disabled="true">
<div class="app-icon" style={ fmt.Sprintf("background:%s", app.Color) }>
{ app.Icon }
</div>
<div class="app-name">{ app.Name }</div>
<div class="app-desc">{ app.Description }</div>
<div class="app-badge">
<span style="color:#f59e0b;">● Coming Soon</span>
</div>
</a>
} else {
<a href={ templ.URL(app.URL) } class="app-card">
<div class="app-icon" style={ fmt.Sprintf("background:%s", app.Color) }>
{ app.Icon }
</div>
<div class="app-name">{ app.Name }</div>
<div class="app-desc">{ app.Description }</div>
<div class="app-badge">
<span style="color:#22c55e;">● Available</span>
</div>
</a>
}
}