API/UI Admin Ekonomi Lowongan kerja
This commit is contained in:
@@ -1,10 +1,13 @@
|
||||
'use client'
|
||||
import colors from '@/con/colors';
|
||||
import { Box, Button, Paper, Table, TableTbody, TableTd, TableTh, TableThead, TableTr } from '@mantine/core';
|
||||
import { Box, Button, Paper, Skeleton, Stack, Table, TableTbody, TableTd, TableTh, TableThead, TableTr } from '@mantine/core';
|
||||
import { IconDeviceImac, IconSearch } from '@tabler/icons-react';
|
||||
import HeaderSearch from '../../_com/header';
|
||||
import JudulList from '../../_com/judulList';
|
||||
import { useRouter } from 'next/navigation';
|
||||
import lowonganKerjaState from '../../_state/ekonomi/lowongan-kerja';
|
||||
import { useProxy } from 'valtio/utils';
|
||||
import { useShallowEffect } from '@mantine/hooks';
|
||||
|
||||
function LowonganKerjaLokal() {
|
||||
return (
|
||||
@@ -20,7 +23,20 @@ function LowonganKerjaLokal() {
|
||||
}
|
||||
|
||||
function ListLowonganKerjaLokal() {
|
||||
const lowonganState = useProxy(lowonganKerjaState)
|
||||
const router = useRouter();
|
||||
|
||||
useShallowEffect(() => {
|
||||
lowonganState.findMany.load();
|
||||
}, [])
|
||||
|
||||
if (!lowonganState.findMany.data) {
|
||||
return (
|
||||
<Stack py={10}>
|
||||
<Skeleton h={500} />
|
||||
</Stack>
|
||||
)
|
||||
}
|
||||
return (
|
||||
<Box py={10}>
|
||||
<Paper bg={colors['white-1']} p={'md'}>
|
||||
@@ -38,16 +54,18 @@ function ListLowonganKerjaLokal() {
|
||||
</TableTr>
|
||||
</TableThead>
|
||||
<TableTbody>
|
||||
<TableTr>
|
||||
<TableTd>Karyawan</TableTd>
|
||||
<TableTd>BIBD</TableTd>
|
||||
<TableTd>Jalan In Aja</TableTd>
|
||||
<TableTd>
|
||||
<Button onClick={() => router.push('/admin/ekonomi/lowongan-kerja-lokal/detail')}>
|
||||
{lowonganState.findMany.data?.map((item) => (
|
||||
<TableTr key={item.id}>
|
||||
<TableTd>{item.posisi}</TableTd>
|
||||
<TableTd>{item.namaPerusahaan}</TableTd>
|
||||
<TableTd>{item.lokasi}</TableTd>
|
||||
<TableTd>
|
||||
<Button onClick={() => router.push(`/admin/ekonomi/lowongan-kerja-lokal/${item.id}`)}>
|
||||
<IconDeviceImac size={20} />
|
||||
</Button>
|
||||
</TableTd>
|
||||
</TableTr>
|
||||
))}
|
||||
</TableTbody>
|
||||
</Table>
|
||||
</Paper>
|
||||
|
||||
Reference in New Issue
Block a user