feat: nama desa di activity logs bisa diklik menuju village detail
This commit is contained in:
@@ -2,6 +2,7 @@ import { useEffect, useState } from 'react'
|
|||||||
import useSWR from 'swr'
|
import useSWR from 'swr'
|
||||||
import {
|
import {
|
||||||
ActionIcon,
|
ActionIcon,
|
||||||
|
Anchor,
|
||||||
Avatar,
|
Avatar,
|
||||||
Badge,
|
Badge,
|
||||||
Code,
|
Code,
|
||||||
@@ -20,7 +21,7 @@ import {
|
|||||||
} from '@mantine/core'
|
} from '@mantine/core'
|
||||||
import { useDebouncedValue, useMediaQuery } from '@mantine/hooks'
|
import { useDebouncedValue, useMediaQuery } from '@mantine/hooks'
|
||||||
import { DatePickerInput } from '@mantine/dates'
|
import { DatePickerInput } from '@mantine/dates'
|
||||||
import { createFileRoute, useParams } from '@tanstack/react-router'
|
import { createFileRoute, useNavigate, useParams } from '@tanstack/react-router'
|
||||||
import {
|
import {
|
||||||
TbAlertCircle,
|
TbAlertCircle,
|
||||||
TbCalendar,
|
TbCalendar,
|
||||||
@@ -42,6 +43,7 @@ interface LogEntry {
|
|||||||
desc: string
|
desc: string
|
||||||
username: string
|
username: string
|
||||||
village: string
|
village: string
|
||||||
|
idVillage: string
|
||||||
}
|
}
|
||||||
|
|
||||||
const fetcher = (url: string) => fetch(url).then((res) => res.json())
|
const fetcher = (url: string) => fetch(url).then((res) => res.json())
|
||||||
@@ -81,6 +83,7 @@ function LogTimestamp({ value }: { value: string }) {
|
|||||||
|
|
||||||
function AppLogsPage() {
|
function AppLogsPage() {
|
||||||
const { appId } = useParams({ from: '/apps/$appId/logs' })
|
const { appId } = useParams({ from: '/apps/$appId/logs' })
|
||||||
|
const navigate = useNavigate()
|
||||||
const [page, setPage] = useState(1)
|
const [page, setPage] = useState(1)
|
||||||
const [search, setSearch] = useState('')
|
const [search, setSearch] = useState('')
|
||||||
const [searchQuery, setSearchQuery] = useState('')
|
const [searchQuery, setSearchQuery] = useState('')
|
||||||
@@ -272,7 +275,15 @@ function AppLogsPage() {
|
|||||||
</Group>
|
</Group>
|
||||||
<Group gap={6} wrap="nowrap">
|
<Group gap={6} wrap="nowrap">
|
||||||
<TbHome2 size={12} color="gray" />
|
<TbHome2 size={12} color="gray" />
|
||||||
<Text size="xs" c="dimmed" truncate="end">{log.village}</Text>
|
<Anchor
|
||||||
|
size="xs"
|
||||||
|
c="dimmed"
|
||||||
|
truncate="end"
|
||||||
|
onClick={() => navigate({ to: `/apps/${appId}/villages/${log.idVillage}` })}
|
||||||
|
style={{ cursor: 'pointer' }}
|
||||||
|
>
|
||||||
|
{log.village}
|
||||||
|
</Anchor>
|
||||||
</Group>
|
</Group>
|
||||||
</Stack>
|
</Stack>
|
||||||
</Table.Td>
|
</Table.Td>
|
||||||
|
|||||||
Reference in New Issue
Block a user