diff --git a/src/module/division_new/ui/create_anggota_division.tsx b/src/module/division_new/ui/create_anggota_division.tsx index 67782ae..3854ab3 100644 --- a/src/module/division_new/ui/create_anggota_division.tsx +++ b/src/module/division_new/ui/create_anggota_division.tsx @@ -3,7 +3,7 @@ import { LayoutNavbarNew, SkeletonSingle, WARNA } from '@/module/_global'; import LayoutModal from '@/module/_global/layout/layout_modal'; import { funGetUserByCookies } from '@/module/auth'; import { funGetAllmember, TypeUser } from '@/module/user'; -import { Avatar, Box, Button, Divider, Flex, Grid, Group, rem, Stack, Text, TextInput } from '@mantine/core'; +import { ActionIcon, Avatar, Box, Button, Center, Divider, Flex, Grid, Group, Indicator, rem, Stack, Text, TextInput } from '@mantine/core'; import { useParams, useRouter } from 'next/navigation'; import React, { useState } from 'react'; import toast from 'react-hot-toast'; @@ -12,6 +12,7 @@ import { HiMagnifyingGlass } from 'react-icons/hi2'; import { useShallowEffect } from '@mantine/hooks'; import { IDataMemberDivision } from '../lib/type_division'; import { funAddDivisionMember, funGetDivisionById } from '../lib/api_division'; +import { IoArrowBackOutline } from 'react-icons/io5'; export default function CreateAnggotaDivision() { @@ -23,6 +24,7 @@ export default function CreateAnggotaDivision() { const [isOpen, setOpen] = useState(false) const param = useParams<{ id: string }>() const [loading, setLoading] = useState(true) + const [onClickSearch, setOnClickSearch] = useState(false) const handleFileClick = (index: number) => { if (selectedFiles.some((i: any) => i.idUser == dataMember[index].id)) { @@ -80,28 +82,82 @@ export default function CreateAnggotaDivision() { loadFirst() }, []); + const handleSearchClick = () => { + setOnClickSearch(true); + }; + + const handleClose = () => { + setOnClickSearch(false); + }; + return ( + + } /> + {onClickSearch + ? ( + + + + + + + + + loadMember(group, e.target.value)} + /> + + + + ) + : null + } + + +
+ + + +
+ Anggota +
+
- - } - placeholder="Pencarian" - onChange={(e: any) => loadMember(group, e.target.value)} - /> - + {/*
{JSON.stringify(memberDb, null, 1)}
*/} {loading ? Array(8) @@ -112,26 +168,23 @@ export default function CreateAnggotaDivision() {
)) : - + {dataMember.map((v: any, index: any) => { const isSelected = selectedFiles.some((i: any) => i.idUser == dataMember[index].id) const found = memberDb.some((i: any) => i.idUser == v.id) return ( (!found) ? handleFileClick(index) : null}> - + - {v.name} - {(found) ? "sudah menjadi anggota divisi" : ""} + {v.name} + {(found) ? "sudah menjadi anggota divisi" : ""} - {isSelected ? : null} + {isSelected ? : null}