import {
IconBolt,
IconBrain,
IconHelp,
IconMapRoute,
IconPlus,
IconSettings,
IconWifiOff,
} from '@tabler/icons-react'
import { Head } from '@inertiajs/react'
import AppLayout from '~/layouts/AppLayout'
import { getServiceLink } from '~/lib/navigation'
import { ServiceSlim } from '../../types/services'
import DynamicIcon, { DynamicIconName } from '~/components/DynamicIcon'
// Maps is a Core Capability (display_order: 4)
const MAPS_ITEM = {
label: 'Maps',
to: '/maps',
target: '',
description: 'View offline maps',
icon: ,
installed: true,
displayOrder: 4,
poweredBy: null,
}
// System items shown after all apps
const SYSTEM_ITEMS = [
{
label: 'Easy Setup',
to: '/easy-setup',
target: '',
description:
'Not sure where to start? Use the setup wizard to quickly configure your N.O.M.A.D.!',
icon: ,
installed: true,
displayOrder: 50,
poweredBy: null,
},
{
label: 'Install Apps',
to: '/settings/apps',
target: '',
description: 'Not seeing your favorite app? Install it here!',
icon: ,
installed: true,
displayOrder: 51,
poweredBy: null,
},
{
label: 'Docs',
to: '/docs/home',
target: '',
description: 'Read Project N.O.M.A.D. manuals and guides',
icon: ,
installed: true,
displayOrder: 52,
poweredBy: null,
},
{
label: 'Settings',
to: '/settings/system',
target: '',
description: 'Configure your N.O.M.A.D. settings',
icon: ,
installed: true,
displayOrder: 53,
poweredBy: null,
},
]
interface DashboardItem {
label: string
to: string
target: string
description: string
icon: React.ReactNode
installed: boolean
displayOrder: number
poweredBy: string | null
}
const KNOWLEDGE_BASE_ITEM: DashboardItem = {
label: 'Knowledge Base',
to: '/knowledge-base',
target: '',
description: 'Upload documents to your personal knowledge base for AI access',
icon: ,
installed: true,
displayOrder: 5,
poweredBy: null,
}
export default function Home(props: {
system: {
services: ServiceSlim[]
}
}) {
const items: DashboardItem[] = []
// Add installed services (non-dependency services only)
props.system.services
.filter((service) => service.installed && service.ui_location)
.forEach((service) => {
items.push({
label: service.friendly_name || service.service_name,
to: service.ui_location ? getServiceLink(service.ui_location) : '#',
target: '_blank',
description:
service.description ||
`Access the ${service.friendly_name || service.service_name} application`,
icon: service.icon ? (
) : (
),
installed: service.installed,
displayOrder: service.display_order ?? 100,
poweredBy: service.powered_by ?? null,
})
})
// Add Maps as a Core Capability
items.push(MAPS_ITEM)
// Add system items
items.push(...SYSTEM_ITEMS)
if (props.system.services.find((s) => s.service_name === 'nomad_open_webui' && s.installed)) {
items.push(KNOWLEDGE_BASE_ITEM)
}
// Sort all items by display order
items.sort((a, b) => a.displayOrder - b.displayOrder)
return (
)
}