"use client"; import { RouterProfile } from "@/app/lib/router_hipmi/router_katalog"; import { MODEL_USER } from "@/app_modules/home/model/interface"; import { ActionIcon, Avatar, Box, Center, Divider, Grid, Paper, Stack, Text, TextInput, Title, } from "@mantine/core"; import { IconChevronRight, IconSearch } from "@tabler/icons-react"; import { useState } from "react"; import { UserSearch_searchByName } from "../fun/search/fun_search_by_name"; import { useRouter } from "next/navigation"; import ComponentGlobal_MaintenanceInformation from "@/app_modules/component_global/maintenance_information"; export default function UserSearch_MainView({ listUser, }: { listUser: MODEL_USER[]; }) { const router = useRouter(); const [user, setUser] = useState(listUser); async function onSearch(name: string) { await UserSearch_searchByName(name).then((res) => setUser(res as any)); } // return ( // <> //
// //
// // ); return ( <> {/*
{JSON.stringify(user, null,2)}
r */} } placeholder="Masukan nama pegguna" onChange={(val) => onSearch(val.target.value)} /> {!user ? ( "" ) : ( {user?.map((e) => e.Profile === null ? ( "" ) : (
{e?.Profile?.name} +{e?.nomor}
router.push( RouterProfile.katalog + `${e?.Profile?.id}` ) } >
) )}
)}
); }