import { useState } from 'react' import { Badge, Container, Group, Stack, Text, Title, Paper, Table, Button, ActionIcon, TextInput, Select, Tooltip, SimpleGrid, Modal, Avatar, Box, NumberInput, } from '@mantine/core' import { useDisclosure } from '@mantine/hooks' import { createFileRoute, useParams } from '@tanstack/react-router' import { TbPlus, TbSearch, TbPencil, TbTrash, TbUserPlus, TbCircleCheck, TbRefresh, TbUser, TbBuildingCommunity, } from 'react-icons/tb' import { StatsCard } from '@/frontend/components/StatsCard' export const Route = createFileRoute('/apps/$appId/manage')({ component: AppManagePage, }) const mockDevelopers = [ { value: 'john-doe', label: 'John Doe', avatar: null }, { value: 'amel', label: 'Amel', avatar: null }, { value: 'jane-smith', label: 'Jane Smith', avatar: null }, { value: 'rahmat', label: 'Rahmat Hidayat', avatar: null }, ] function AppManagePage() { const { appId } = useParams({ from: '/apps/$appId' }) const [initModalOpened, { open: openInit, close: closeInit }] = useDisclosure(false) const [assignModalOpened, { open: openAssign, close: closeAssign }] = useDisclosure(false) const [selectedVillage, setSelectedVillage] = useState(null) const isDesaPlus = appId === 'desa-plus' const mockVillages = [ { id: 1, name: 'Sukatani', kecamatan: 'Tapos', population: 4500, status: 'fully integrated', developer: 'John Doe', lastUpdate: '2 mins ago' }, { id: 2, name: 'Sukamaju', kecamatan: 'Cilodong', population: 3800, status: 'sync active', developer: 'Amel', lastUpdate: '15 mins ago' }, { id: 3, name: 'Cikini', kecamatan: 'Menteng', population: 2100, status: 'sync pending', developer: 'Jane Smith', lastUpdate: '-' }, { id: 4, name: 'Bojong Gede', kecamatan: 'Bojong Gede', population: 6700, status: 'fully integrated', developer: 'Rahmat', lastUpdate: '1 hour ago' }, ] if (!isDesaPlus) { return ( General Management This feature is currently customized for Desa+. Other apps coming soon. ) } return ( {/* Metrics Row */} Village Deployment Center Monitor and configure **Desa+** village instances across all districts. } style={{ flex: 1 }} radius="md" /> Village Profile District Integration Status Lead Developer Last Sync Actions {mockVillages.map((village) => ( {village.name} {village.population.toLocaleString()} Residents {village.kecamatan} } radius="sm" style={{ textTransform: 'uppercase', fontVariant: 'small-caps' }} > {village.status} {village.developer} { setSelectedVillage(village); openAssign(); }} > {village.lastUpdate} {village.status === 'sync pending' && ( )} ))}
{/* MODALS */} Desa+ Instance Initialization} radius="xl" centered padding="xl" > } radius="md" searchable />
) }