style : update style kegiatan
Deskripsi: - update project atau kegiatan No Issue
This commit is contained in:
@@ -33,7 +33,7 @@ export async function POST(request: Request, context: { params: { id: string } }
|
|||||||
|
|
||||||
if (member.length > 0) {
|
if (member.length > 0) {
|
||||||
const dataMember = member.map((v: any) => ({
|
const dataMember = member.map((v: any) => ({
|
||||||
..._.omit(v, ["idUser", "name"]),
|
..._.omit(v, ["idUser", "name", "img"]),
|
||||||
idProject: id,
|
idProject: id,
|
||||||
idUser: v.idUser
|
idUser: v.idUser
|
||||||
}))
|
}))
|
||||||
@@ -110,6 +110,8 @@ export async function GET(request: Request, context: { params: { id: string } })
|
|||||||
const { id } = context.params
|
const { id } = context.params
|
||||||
const groupId = user.idGroup
|
const groupId = user.idGroup
|
||||||
const userId = user.id
|
const userId = user.id
|
||||||
|
const { searchParams } = new URL(request.url);
|
||||||
|
const name = searchParams.get('search');
|
||||||
|
|
||||||
const data = await prisma.project.findUnique({
|
const data = await prisma.project.findUnique({
|
||||||
where: {
|
where: {
|
||||||
@@ -128,39 +130,18 @@ export async function GET(request: Request, context: { params: { id: string } })
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// const member = await prisma.projectMember.findMany({
|
|
||||||
// where: {
|
|
||||||
// idProject: String(id),
|
|
||||||
// isActive: true
|
|
||||||
// },
|
|
||||||
// select: {
|
|
||||||
// id: true,
|
|
||||||
// isLeader: true,
|
|
||||||
// idUser: true,
|
|
||||||
// User: {
|
|
||||||
// select: {
|
|
||||||
// name: true
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// },
|
|
||||||
// orderBy: {
|
|
||||||
// isLeader: 'desc',
|
|
||||||
// }
|
|
||||||
// })
|
|
||||||
|
|
||||||
// const fixMember = member.map((v: any) => ({
|
|
||||||
// ..._.omit(v, ["User"]),
|
|
||||||
// name: v.User.name
|
|
||||||
// }))
|
|
||||||
|
|
||||||
const member = await prisma.user.findMany({
|
const member = await prisma.user.findMany({
|
||||||
where: {
|
where: {
|
||||||
idGroup: String(groupId),
|
idGroup: String(groupId),
|
||||||
id: {
|
id: {
|
||||||
not: String(userId)
|
not: String(userId)
|
||||||
},
|
},
|
||||||
isActive: true
|
isActive: true,
|
||||||
|
name: {
|
||||||
|
contains: (name == undefined || name == "null") ? "" : name,
|
||||||
|
mode: 'insensitive'
|
||||||
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
select: {
|
select: {
|
||||||
id: true,
|
id: true,
|
||||||
|
|||||||
@@ -19,8 +19,8 @@ export const funGetOneProjectById = async (path: string, kategori: string) => {
|
|||||||
return await response.json().catch(() => null);
|
return await response.json().catch(() => null);
|
||||||
}
|
}
|
||||||
|
|
||||||
export const funGetAllMemberById = async (path?: string) => {
|
export const funGetAllMemberById = async (path?: string, id?:string) => {
|
||||||
const response = await fetch(`/api/project/${path}/member`);
|
const response = await fetch(`/api/project/${id}/member/${path}`);
|
||||||
return await response.json().catch(() => null);
|
return await response.json().catch(() => null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -5,10 +5,13 @@ import { IDataMemberProject, IDataMemberProjectDetail } from '../lib/type_projec
|
|||||||
import toast from 'react-hot-toast';
|
import toast from 'react-hot-toast';
|
||||||
import { funAddMemberProject, funGetAllMemberById, funGetOneProjectById } from '../lib/api_project';
|
import { funAddMemberProject, funGetAllMemberById, funGetOneProjectById } from '../lib/api_project';
|
||||||
import { useShallowEffect } from '@mantine/hooks';
|
import { useShallowEffect } from '@mantine/hooks';
|
||||||
import { Avatar, Box, Button, Divider, Flex, Grid, Group, rem, Skeleton, Stack, Text } from '@mantine/core';
|
import { ActionIcon, Avatar, Box, Button, Center, Divider, Flex, Grid, Group, Indicator, rem, Skeleton, Stack, Text, TextInput } from '@mantine/core';
|
||||||
import { LayoutNavbarNew, SkeletonSingle, WARNA } from '@/module/_global';
|
import { LayoutNavbarNew, SkeletonSingle, WARNA } from '@/module/_global';
|
||||||
import { FaCheck } from 'react-icons/fa6';
|
import { FaCheck } from 'react-icons/fa6';
|
||||||
import LayoutModal from '@/module/_global/layout/layout_modal';
|
import LayoutModal from '@/module/_global/layout/layout_modal';
|
||||||
|
import { HiMagnifyingGlass } from 'react-icons/hi2';
|
||||||
|
import { IoArrowBackOutline, IoClose } from 'react-icons/io5';
|
||||||
|
import { Carousel } from '@mantine/carousel';
|
||||||
|
|
||||||
export default function AddMemberDetailProject() {
|
export default function AddMemberDetailProject() {
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
@@ -19,12 +22,14 @@ export default function AddMemberDetailProject() {
|
|||||||
const [selectAll, setSelectAll] = useState(false)
|
const [selectAll, setSelectAll] = useState(false)
|
||||||
const [loading, setLoading] = useState(true)
|
const [loading, setLoading] = useState(true)
|
||||||
const [openModal, setOpenModal] = useState(false)
|
const [openModal, setOpenModal] = useState(false)
|
||||||
|
const [onClickSearch, setOnClickSearch] = useState(false)
|
||||||
|
const [searchQuery, setSearchQuery] = useState('')
|
||||||
|
|
||||||
|
|
||||||
async function getData() {
|
async function getData() {
|
||||||
try {
|
try {
|
||||||
setLoading(true)
|
setLoading(true)
|
||||||
const response = await funGetAllMemberById(param.id)
|
const response = await funGetAllMemberById('?search=' + searchQuery, param.id )
|
||||||
if (response.success) {
|
if (response.success) {
|
||||||
setData(response.data.member)
|
setData(response.data.member)
|
||||||
} else {
|
} else {
|
||||||
@@ -49,7 +54,7 @@ export default function AddMemberDetailProject() {
|
|||||||
if (selectedFiles.some((i: any) => i.idUser == isData[index].idUser)) {
|
if (selectedFiles.some((i: any) => i.idUser == isData[index].idUser)) {
|
||||||
setSelectedFiles(selectedFiles.filter((i: any) => i.idUser != isData[index].idUser))
|
setSelectedFiles(selectedFiles.filter((i: any) => i.idUser != isData[index].idUser))
|
||||||
} else {
|
} else {
|
||||||
setSelectedFiles([...selectedFiles, { idUser: isData[index].idUser, name: isData[index].name }])
|
setSelectedFiles([...selectedFiles, { idUser: isData[index].idUser, name: isData[index].name, img: isData[index].img }])
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -62,7 +67,7 @@ export default function AddMemberDetailProject() {
|
|||||||
if (!isDataMember.some((i: any) => i.idUser == isData[index].idUser)) {
|
if (!isDataMember.some((i: any) => i.idUser == isData[index].idUser)) {
|
||||||
if (!selectedFiles.some((i: any) => i.idUser == isData[index].idUser)) {
|
if (!selectedFiles.some((i: any) => i.idUser == isData[index].idUser)) {
|
||||||
const newArr = {
|
const newArr = {
|
||||||
idUser: isData[index].idUser, name: isData[index].name
|
idUser: isData[index].idUser, name: isData[index].name, img: isData[index].img
|
||||||
}
|
}
|
||||||
setSelectedFiles((selectedFiles: any) => [...selectedFiles, newArr])
|
setSelectedFiles((selectedFiles: any) => [...selectedFiles, newArr])
|
||||||
}
|
}
|
||||||
@@ -85,7 +90,7 @@ export default function AddMemberDetailProject() {
|
|||||||
|
|
||||||
useShallowEffect(() => {
|
useShallowEffect(() => {
|
||||||
getData()
|
getData()
|
||||||
}, []);
|
}, [searchQuery]);
|
||||||
|
|
||||||
async function onSubmit() {
|
async function onSubmit() {
|
||||||
try {
|
try {
|
||||||
@@ -102,15 +107,107 @@ export default function AddMemberDetailProject() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const handleSearchClick = () => {
|
||||||
|
setOnClickSearch(true);
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleClose = () => {
|
||||||
|
setOnClickSearch(false);
|
||||||
|
};
|
||||||
|
|
||||||
|
function handleXMember(id: number) {
|
||||||
|
setSelectedFiles(selectedFiles.filter((i: any) => i.idUser != id))
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Box>
|
<Box>
|
||||||
<LayoutNavbarNew
|
<LayoutNavbarNew
|
||||||
back=""
|
back=""
|
||||||
title="Pilih Anggota"
|
title="Pilih Anggota"
|
||||||
menu
|
menu={<ActionIcon onClick={handleSearchClick} variant="light" bg={WARNA.bgIcon} size="lg" radius="lg" aria-label="search">
|
||||||
|
<HiMagnifyingGlass size={20} color='white' />
|
||||||
|
</ActionIcon>}
|
||||||
/>
|
/>
|
||||||
|
{/* SEARCH */}
|
||||||
|
{onClickSearch
|
||||||
|
? (
|
||||||
|
<Box
|
||||||
|
pos={'fixed'} top={0} p={rem(20)} w={"100%"} style={{
|
||||||
|
maxWidth: rem(550),
|
||||||
|
zIndex: 9999,
|
||||||
|
backgroundColor: `${WARNA.biruTua}`,
|
||||||
|
borderBottomLeftRadius: 20,
|
||||||
|
borderBottomRightRadius: 20,
|
||||||
|
}}>
|
||||||
|
<Grid justify='center' align='center' gutter={'lg'}>
|
||||||
|
<Grid.Col span={1}>
|
||||||
|
<ActionIcon onClick={handleClose} variant="subtle" color='white' size="lg" mt={5} radius="lg" aria-label="search">
|
||||||
|
<IoArrowBackOutline size={30} />
|
||||||
|
</ActionIcon>
|
||||||
|
</Grid.Col>
|
||||||
|
<Grid.Col span={11}>
|
||||||
|
<TextInput
|
||||||
|
styles={{
|
||||||
|
input: {
|
||||||
|
color: "white",
|
||||||
|
borderRadius: '#A3A3A3',
|
||||||
|
borderColor: `${WARNA.biruTua}`,
|
||||||
|
backgroundColor: `${WARNA.biruTua}`,
|
||||||
|
},
|
||||||
|
}}
|
||||||
|
size="md"
|
||||||
|
radius={30}
|
||||||
|
placeholder="Pencarian"
|
||||||
|
onChange={(e) => setSearchQuery(e.target.value)}
|
||||||
|
/>
|
||||||
|
</Grid.Col>
|
||||||
|
</Grid>
|
||||||
|
</Box>
|
||||||
|
)
|
||||||
|
: null
|
||||||
|
}
|
||||||
|
{/* Close User */}
|
||||||
|
<Box pos={'fixed'} top={80} pl={rem(20)} pr={rem(20)} pt={rem(20)} pb={rem(5)} w={"100%"} style={{
|
||||||
|
maxWidth: rem(550),
|
||||||
|
zIndex: 100,
|
||||||
|
backgroundColor: `${WARNA.bgWhite}`,
|
||||||
|
borderBottom: `1px solid ${"#E0DFDF"}`
|
||||||
|
}}>
|
||||||
|
{selectedFiles.length > 0 ? (
|
||||||
|
<Carousel dragFree slideGap={"xs"} align="start" slideSize={"xs"} withIndicators withControls={false}>
|
||||||
|
{selectedFiles.map((v: any, i: any) => {
|
||||||
|
return (
|
||||||
|
<Carousel.Slide key={i}>
|
||||||
|
<Box w={{
|
||||||
|
base: 70,
|
||||||
|
xl: 70
|
||||||
|
}}
|
||||||
|
onClick={() => { handleXMember(v.idUser) }}
|
||||||
|
>
|
||||||
|
<Center>
|
||||||
|
<Indicator inline size={25} offset={7} position="bottom-end" color="red" withBorder label={<IoClose />}>
|
||||||
|
<Avatar style={{
|
||||||
|
border: `2px solid ${WARNA.biruTua}`
|
||||||
|
}} src={`/api/file/img?jenis=image&cat=user&file=${v.img}`} alt="it's me" size="lg" />
|
||||||
|
</Indicator>
|
||||||
|
</Center>
|
||||||
|
<Text ta={"center"} lineClamp={1}>{v.name}</Text>
|
||||||
|
</Box>
|
||||||
|
</Carousel.Slide>
|
||||||
|
)
|
||||||
|
})}
|
||||||
|
</Carousel>
|
||||||
|
) : (
|
||||||
|
<Box h={rem(81)}>
|
||||||
|
<Flex justify={"center"} align={'center'} h={"100%"}>
|
||||||
|
<Text ta={'center'} fz={14}>Tidak ada anggota yang dipilih</Text>
|
||||||
|
</Flex>
|
||||||
|
</Box>
|
||||||
|
)}
|
||||||
|
</Box>
|
||||||
|
|
||||||
<Box p={20}>
|
<Box p={20}>
|
||||||
<Group justify="space-between" mt={20} onClick={handleSelectAll}>
|
<Group justify="space-between" mt={100} onClick={handleSelectAll}>
|
||||||
<Text c={WARNA.biruTua} fw={"bold"}>
|
<Text c={WARNA.biruTua} fw={"bold"}>
|
||||||
Pilih Semua Anggota
|
Pilih Semua Anggota
|
||||||
</Text>
|
</Text>
|
||||||
@@ -131,32 +228,6 @@ export default function AddMemberDetailProject() {
|
|||||||
const found = isDataMember.some((i: any) => i.idUser == v.idUser)
|
const found = isDataMember.some((i: any) => i.idUser == v.idUser)
|
||||||
return (
|
return (
|
||||||
<Box mb={15} key={i} onClick={() => (!found) ? handleFileClick(i) : null}>
|
<Box mb={15} key={i} onClick={() => (!found) ? handleFileClick(i) : null}>
|
||||||
{/* <Flex justify={"space-between"} align={"center"}>
|
|
||||||
<Group>
|
|
||||||
<Avatar src={`/api/file/img?jenis=image&cat=user&file=${v.img}`} alt="it's me" size="lg" />
|
|
||||||
<Stack align="flex-start" justify="flex-start">
|
|
||||||
<Text style={{
|
|
||||||
cursor: 'pointer',
|
|
||||||
display: 'flex',
|
|
||||||
alignItems: 'center',
|
|
||||||
}}>
|
|
||||||
{v.name}
|
|
||||||
</Text>
|
|
||||||
<Text c={"dimmed"}>{(found) ? "sudah menjadi anggota" : ""}</Text>
|
|
||||||
</Stack>
|
|
||||||
</Group>
|
|
||||||
<Text
|
|
||||||
style={{
|
|
||||||
cursor: 'pointer',
|
|
||||||
display: 'flex',
|
|
||||||
alignItems: 'center',
|
|
||||||
paddingLeft: 20,
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
{isSelected ? <FaCheck style={{ marginRight: 10 }} /> : ""}
|
|
||||||
</Text>
|
|
||||||
</Flex>
|
|
||||||
<Divider my={"md"} /> */}
|
|
||||||
<Grid align='center'>
|
<Grid align='center'>
|
||||||
<Grid.Col span={{
|
<Grid.Col span={{
|
||||||
base: 3,
|
base: 3,
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
"use client"
|
"use client"
|
||||||
import { LayoutNavbarNew, WARNA } from '@/module/_global';
|
import { LayoutNavbarNew, SkeletonSingle, WARNA } from '@/module/_global';
|
||||||
import { useHookstate } from '@hookstate/core';
|
import { useHookstate } from '@hookstate/core';
|
||||||
import { ActionIcon, Avatar, Box, Button, Center, Input, rem, SimpleGrid, Skeleton, Stack, Text, TextInput } from '@mantine/core';
|
import { ActionIcon, Avatar, Box, Button, Center, Divider, Flex, Grid, Indicator, Input, rem, SimpleGrid, Skeleton, Stack, Text, TextInput } from '@mantine/core';
|
||||||
import { useShallowEffect } from '@mantine/hooks';
|
import { useShallowEffect } from '@mantine/hooks';
|
||||||
import { useRouter } from 'next/navigation';
|
import { useRouter } from 'next/navigation';
|
||||||
import React, { useState } from 'react';
|
import React, { useState } from 'react';
|
||||||
@@ -10,6 +10,9 @@ import { funGetAllmember, TypeUser } from '@/module/user';
|
|||||||
import { funGetUserByCookies } from '@/module/auth';
|
import { funGetUserByCookies } from '@/module/auth';
|
||||||
import toast from 'react-hot-toast';
|
import toast from 'react-hot-toast';
|
||||||
import { globalMemberProject } from '../lib/val_project';
|
import { globalMemberProject } from '../lib/val_project';
|
||||||
|
import { FaCheck } from 'react-icons/fa6';
|
||||||
|
import { IoArrowBackOutline, IoClose } from 'react-icons/io5';
|
||||||
|
import { Carousel } from '@mantine/carousel';
|
||||||
|
|
||||||
|
|
||||||
export default function CreateUsersProject({ grup, onClose }: { grup?: string, onClose: (val: any) => void }) {
|
export default function CreateUsersProject({ grup, onClose }: { grup?: string, onClose: (val: any) => void }) {
|
||||||
@@ -19,6 +22,7 @@ export default function CreateUsersProject({ grup, onClose }: { grup?: string, o
|
|||||||
const [dataMember, setDataMember] = useState<TypeUser>([])
|
const [dataMember, setDataMember] = useState<TypeUser>([])
|
||||||
const [loading, setLoading] = useState(true)
|
const [loading, setLoading] = useState(true)
|
||||||
const [openTugas, setOpenTugas] = useState(false)
|
const [openTugas, setOpenTugas] = useState(false)
|
||||||
|
const [onClickSearch, setOnClickSearch] = useState(false)
|
||||||
|
|
||||||
const handleFileClick = (index: number) => {
|
const handleFileClick = (index: number) => {
|
||||||
if (selectedFiles.some((i: any) => i.idUser == dataMember[index].id)) {
|
if (selectedFiles.some((i: any) => i.idUser == dataMember[index].id)) {
|
||||||
@@ -60,6 +64,18 @@ export default function CreateUsersProject({ grup, onClose }: { grup?: string, o
|
|||||||
loadData("")
|
loadData("")
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
|
const handleSearchClick = () => {
|
||||||
|
setOnClickSearch(true);
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleClose = () => {
|
||||||
|
setOnClickSearch(false);
|
||||||
|
};
|
||||||
|
|
||||||
|
function handleXMember(id: number) {
|
||||||
|
setSelectedFiles(selectedFiles.filter((i: any) => i.idUser != id))
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Box>
|
<Box>
|
||||||
<LayoutNavbarNew state={
|
<LayoutNavbarNew state={
|
||||||
@@ -68,68 +84,129 @@ export default function CreateUsersProject({ grup, onClose }: { grup?: string, o
|
|||||||
<HiChevronLeft size={20} color='white' />
|
<HiChevronLeft size={20} color='white' />
|
||||||
</ActionIcon>
|
</ActionIcon>
|
||||||
</Box>
|
</Box>
|
||||||
} title="Pilih Anggota" menu />
|
} title="Pilih Anggota"
|
||||||
|
menu={<ActionIcon onClick={handleSearchClick} variant="light" bg={WARNA.bgIcon} size="lg" radius="lg" aria-label="search">
|
||||||
|
<HiMagnifyingGlass size={20} color='white' />
|
||||||
|
</ActionIcon>}
|
||||||
|
/>
|
||||||
|
{/* SEARCH */}
|
||||||
|
{onClickSearch
|
||||||
|
? (
|
||||||
|
<Box
|
||||||
|
pos={'fixed'} top={0} p={rem(20)} w={"100%"} style={{
|
||||||
|
maxWidth: rem(550),
|
||||||
|
zIndex: 9999,
|
||||||
|
backgroundColor: `${WARNA.biruTua}`,
|
||||||
|
borderBottomLeftRadius: 20,
|
||||||
|
borderBottomRightRadius: 20,
|
||||||
|
}}>
|
||||||
|
<Grid justify='center' align='center' gutter={'lg'}>
|
||||||
|
<Grid.Col span={1}>
|
||||||
|
<ActionIcon onClick={handleClose} variant="subtle" color='white' size="lg" mt={5} radius="lg" aria-label="search">
|
||||||
|
<IoArrowBackOutline size={30} />
|
||||||
|
</ActionIcon>
|
||||||
|
</Grid.Col>
|
||||||
|
<Grid.Col span={11}>
|
||||||
|
<TextInput
|
||||||
|
styles={{
|
||||||
|
input: {
|
||||||
|
color: "white",
|
||||||
|
borderRadius: '#A3A3A3',
|
||||||
|
borderColor: `${WARNA.biruTua}`,
|
||||||
|
backgroundColor: `${WARNA.biruTua}`,
|
||||||
|
},
|
||||||
|
}}
|
||||||
|
size="md"
|
||||||
|
radius={30}
|
||||||
|
placeholder="Pencarian"
|
||||||
|
onChange={(e) => loadData(e.target.value)}
|
||||||
|
/>
|
||||||
|
</Grid.Col>
|
||||||
|
</Grid>
|
||||||
|
</Box>
|
||||||
|
)
|
||||||
|
: null
|
||||||
|
}
|
||||||
|
{/* Close User */}
|
||||||
|
<Box pos={'fixed'} top={80} pl={rem(20)} pr={rem(20)} pt={rem(20)} pb={rem(5)} w={"100%"} style={{
|
||||||
|
maxWidth: rem(550),
|
||||||
|
zIndex: 100,
|
||||||
|
backgroundColor: `${WARNA.bgWhite}`,
|
||||||
|
borderBottom: `1px solid ${"#E0DFDF"}`
|
||||||
|
}}>
|
||||||
|
{selectedFiles.length > 0 ? (
|
||||||
|
<Carousel dragFree slideGap={"xs"} align="start" slideSize={"xs"} withIndicators withControls={false}>
|
||||||
|
{selectedFiles.map((v: any, i: any) => {
|
||||||
|
return (
|
||||||
|
<Carousel.Slide key={i}>
|
||||||
|
<Box w={{
|
||||||
|
base: 70,
|
||||||
|
xl: 70
|
||||||
|
}}
|
||||||
|
onClick={() => { handleXMember(v.idUser) }}
|
||||||
|
>
|
||||||
|
<Center>
|
||||||
|
<Indicator inline size={25} offset={7} position="bottom-end" color="red" withBorder label={<IoClose />}>
|
||||||
|
<Avatar style={{
|
||||||
|
border: `2px solid ${WARNA.biruTua}`
|
||||||
|
}} src={`/api/file/img?jenis=image&cat=user&file=${v.img}`} alt="it's me" size="lg" />
|
||||||
|
</Indicator>
|
||||||
|
</Center>
|
||||||
|
<Text ta={"center"} lineClamp={1}>{v.name}</Text>
|
||||||
|
</Box>
|
||||||
|
</Carousel.Slide>
|
||||||
|
)
|
||||||
|
})}
|
||||||
|
</Carousel>
|
||||||
|
) : (
|
||||||
|
<Box h={rem(81)}>
|
||||||
|
<Flex justify={"center"} align={'center'} h={"100%"}>
|
||||||
|
<Text ta={'center'} fz={14}>Tidak ada anggota yang dipilih</Text>
|
||||||
|
</Flex>
|
||||||
|
</Box>
|
||||||
|
)}
|
||||||
|
</Box>
|
||||||
<Box p={20}>
|
<Box p={20}>
|
||||||
<Stack>
|
<Stack>
|
||||||
<TextInput
|
<Box pt={100} mb={100}>
|
||||||
styles={{
|
|
||||||
input: {
|
|
||||||
color: WARNA.biruTua,
|
|
||||||
borderRadius: '#A3A3A3',
|
|
||||||
borderColor: '#A3A3A3',
|
|
||||||
},
|
|
||||||
}}
|
|
||||||
size="md"
|
|
||||||
radius={30}
|
|
||||||
leftSection={<HiMagnifyingGlass size={20} />}
|
|
||||||
placeholder="Pencarian"
|
|
||||||
onChange={(e) => loadData(e.target.value)}
|
|
||||||
/>
|
|
||||||
<Box pt={10} mb={100}>
|
|
||||||
{loading ?
|
{loading ?
|
||||||
<SimpleGrid
|
Array(6)
|
||||||
cols={{ base: 2, sm: 2, lg: 2 }}
|
.fill(null)
|
||||||
spacing={{ base: 20, sm: "xl" }}
|
.map((_, i) => (
|
||||||
verticalSpacing={{ base: "md", sm: "xl" }}
|
<Box key={i}>
|
||||||
>
|
<SkeletonSingle />
|
||||||
{Array(6)
|
</Box>
|
||||||
.fill(null)
|
))
|
||||||
.map((_, i) => (
|
|
||||||
<Box key={i}>
|
|
||||||
<Skeleton width={"100%"} height={150} radius={20} />
|
|
||||||
</Box>
|
|
||||||
))}
|
|
||||||
</SimpleGrid>
|
|
||||||
:
|
:
|
||||||
<SimpleGrid
|
dataMember.map((v, index) => {
|
||||||
cols={{ base: 2, sm: 2, lg: 2 }}
|
const isSelected = selectedFiles.some((i: any) => i.idUser == dataMember[index].id);
|
||||||
spacing={{ base: 20, sm: "xl" }}
|
return (
|
||||||
verticalSpacing={{ base: "md", sm: "xl" }}
|
<Box mb={15} key={index} onClick={() => handleFileClick(index)}>
|
||||||
>
|
<Grid align='center'>
|
||||||
{dataMember.map((v, index) => {
|
<Grid.Col span={{
|
||||||
const isSelected = selectedFiles.some((i: any) => i.idUser == dataMember[index].id);
|
base: 3,
|
||||||
return (
|
xl: 2
|
||||||
<Box key={index} mb={10}>
|
}}>
|
||||||
<Box
|
<Avatar src={`/api/file/img?jenis=image&cat=user&file=${v.img}`} alt="it's me" size="lg" />
|
||||||
bg={isSelected ? WARNA.bgHijauMuda : "white"}
|
</Grid.Col>
|
||||||
style={{
|
<Grid.Col span={{
|
||||||
border: `1px solid ${WARNA.biruTua}`,
|
base: 9,
|
||||||
borderRadius: 20,
|
xl: 10
|
||||||
}}
|
}}>
|
||||||
py={10}
|
<Flex justify='space-between' align={"center"}>
|
||||||
onClick={() => handleFileClick(index)}
|
<Flex direction={'column'} align="flex-start" justify="flex-start">
|
||||||
>
|
<Text lineClamp={1}>{v.name}</Text>
|
||||||
<Center>
|
</Flex>
|
||||||
<Avatar src={`/api/file/img?jenis=image&cat=user&file=${v.img}`} alt="it's me" size="xl" />
|
{isSelected ? <FaCheck /> : null}
|
||||||
</Center>
|
</Flex>
|
||||||
<Text mt={20} ta="center" lineClamp={1}>
|
</Grid.Col>
|
||||||
{v.name}
|
</Grid>
|
||||||
</Text>
|
<Box mt={10}>
|
||||||
</Box>
|
<Divider size={"xs"} />
|
||||||
</Box>
|
</Box>
|
||||||
);
|
</Box>
|
||||||
})}
|
);
|
||||||
</SimpleGrid>
|
})
|
||||||
}
|
}
|
||||||
</Box>
|
</Box>
|
||||||
</Stack>
|
</Stack>
|
||||||
|
|||||||
Reference in New Issue
Block a user