Fix: Avatar
Deskripsi: - Avatar job - Avatar collaboration - Avatar event ## No Issuue
This commit is contained in:
@@ -1,14 +1,15 @@
|
||||
"use client";
|
||||
|
||||
import { RouterProfile } from "@/app/lib/router_hipmi/router_katalog";
|
||||
import { ComponentGlobal_LoaderAvatar } from "@/app_modules/_global/component";
|
||||
import ComponentGlobal_IsEmptyData from "@/app_modules/_global/component/is_empty_data";
|
||||
import ComponentGlobal_Loader from "@/app_modules/_global/component/loader";
|
||||
import { MODEL_USER } from "@/app_modules/home/model/interface";
|
||||
import {
|
||||
ActionIcon,
|
||||
Avatar,
|
||||
Box,
|
||||
Center,
|
||||
Grid,
|
||||
Group,
|
||||
Loader,
|
||||
Stack,
|
||||
@@ -21,7 +22,6 @@ import { ScrollOnly } from "next-scroll-loader";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { useState } from "react";
|
||||
import { userSearch_getAllUser } from "../fun/get/get_all_user";
|
||||
import { ComponentGlobal_LoaderAvatar } from "@/app_modules/_global/component";
|
||||
|
||||
export function UserSearch_UiView({ listUser }: { listUser: MODEL_USER[] }) {
|
||||
const [data, setData] = useState(listUser);
|
||||
@@ -45,12 +45,12 @@ export function UserSearch_UiView({ listUser }: { listUser: MODEL_USER[] }) {
|
||||
radius={"xl"}
|
||||
style={{ zIndex: 99 }}
|
||||
icon={<IconSearch size={20} />}
|
||||
placeholder="Masukan username "
|
||||
placeholder="Masukan nama pengguna "
|
||||
onChange={(val) => onSearch(val.target.value)}
|
||||
/>
|
||||
<Box>
|
||||
{_.isEmpty(data) ? (
|
||||
<ComponentGlobal_IsEmptyData text="Username tidak ditemukan" />
|
||||
<ComponentGlobal_IsEmptyData text="Pengguna tidak ditemukan" />
|
||||
) : (
|
||||
<ScrollOnly
|
||||
height="84vh"
|
||||
@@ -76,7 +76,6 @@ export function UserSearch_UiView({ listUser }: { listUser: MODEL_USER[] }) {
|
||||
)}
|
||||
</Box>
|
||||
</Stack>
|
||||
{/* <pre>{JSON.stringify(data, null, 2)}</pre> */}
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -87,7 +86,47 @@ function CardView({ data }: { data: MODEL_USER }) {
|
||||
|
||||
return (
|
||||
<>
|
||||
<Stack
|
||||
<Grid
|
||||
w={"100%"}
|
||||
onClick={() => {
|
||||
setLoading(true);
|
||||
router.push(RouterProfile.katalog({ id: data.Profile.id }));
|
||||
}}
|
||||
>
|
||||
<Grid.Col span={2}>
|
||||
<Group h={"100%"} align="center">
|
||||
<ComponentGlobal_LoaderAvatar
|
||||
fileId={data.Profile.imageId as any}
|
||||
imageSize="100"
|
||||
/>
|
||||
</Group>
|
||||
</Grid.Col>
|
||||
<Grid.Col span={"auto"} c={"white"}>
|
||||
<Stack spacing={0}>
|
||||
<Text fw={"bold"} lineClamp={1}>
|
||||
{data?.Profile.name}
|
||||
</Text>
|
||||
<Text fz={"sm"} fs={"italic"}>
|
||||
+{data?.nomor}
|
||||
</Text>
|
||||
</Stack>
|
||||
</Grid.Col>
|
||||
<Grid.Col span={2}>
|
||||
<Group position="right" align="center" h={"100%"}>
|
||||
<Center>
|
||||
<ActionIcon variant="transparent">
|
||||
{loading ? (
|
||||
<ComponentGlobal_Loader />
|
||||
) : (
|
||||
<IconChevronRight color="white" />
|
||||
)}
|
||||
</ActionIcon>
|
||||
</Center>
|
||||
</Group>
|
||||
</Grid.Col>
|
||||
</Grid>
|
||||
|
||||
{/* <Stack
|
||||
spacing={"xs"}
|
||||
c="white"
|
||||
py={"xs"}
|
||||
@@ -96,8 +135,9 @@ function CardView({ data }: { data: MODEL_USER }) {
|
||||
router.push(RouterProfile.katalogOLD + `${data?.Profile?.id}`);
|
||||
}}
|
||||
>
|
||||
<Group position="apart">
|
||||
<Group position="left">
|
||||
|
||||
<Group position="apart" grow>
|
||||
<Group position="left" bg={"blue"}>
|
||||
<ComponentGlobal_LoaderAvatar
|
||||
fileId={data.Profile.imageId as any}
|
||||
imageSize="100"
|
||||
@@ -105,7 +145,7 @@ function CardView({ data }: { data: MODEL_USER }) {
|
||||
|
||||
<Stack spacing={0}>
|
||||
<Text fw={"bold"} lineClamp={1}>
|
||||
{data?.username}
|
||||
{data?.Profile.name}d sdasd sdas
|
||||
</Text>
|
||||
<Text fz={"sm"} fs={"italic"}>
|
||||
+{data?.nomor}
|
||||
@@ -125,7 +165,7 @@ function CardView({ data }: { data: MODEL_USER }) {
|
||||
</Center>
|
||||
</Group>
|
||||
</Group>
|
||||
</Stack>
|
||||
</Stack> */}
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -24,10 +24,13 @@ export async function userSearch_getAllUser({
|
||||
where: {
|
||||
active: true,
|
||||
masterUserRoleId: "1",
|
||||
username: {
|
||||
contains: search,
|
||||
mode: "insensitive",
|
||||
Profile: {
|
||||
name: {
|
||||
contains: search,
|
||||
mode: "insensitive",
|
||||
},
|
||||
},
|
||||
|
||||
NOT: {
|
||||
Profile: null,
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user