import { FC, ReactElement, useRef, useState } from 'react'; import { BannerSection } from './_components/banner-section'; import { Topics } from './_components/topics'; import { Input } from '@imphnen-frontend-service/ui/atoms'; import { SearchOutlined } from '@ant-design/icons'; import { For, Show } from '@imphnen-frontend-service/utils'; import { MentorCard } from './_components/mentor-card'; import { Pagination } from '@imphnen-frontend-service/ui/molecules'; import { useGetMentors } from '@imphnen-frontend-service/service'; import { getCoreRowModel, getPaginationRowModel, PaginationState, useReactTable } from '@tanstack/react-table'; import { motion, useInView, Variants } from 'framer-motion'; export const Components: FC = (): ReactElement => { const [pagination, setPagination] = useState({ pageIndex: 0, pageSize: 8, }); const [search, setSearch] = useState(''); const { data: mentors, isLoading } = useGetMentors({ search }); const table = useReactTable({ data: mentors ?? [], columns: [], state: { pagination }, getCoreRowModel: getCoreRowModel(), getPaginationRowModel: getPaginationRowModel(), onPaginationChange: setPagination, }); const pageMentors = table.getRowModel().rows.map((row) => row.original); const ref = useRef(null) const isInView = useInView(ref, { once: true, amount: 0.2 }) const containerVariants: Variants = { hidden: { opacity: 0 }, visible: { opacity: 1, transition: { staggerChildren: 0.1, delayChildren: 0.3, }, }, } const childVariants: Variants = { hidden: { opacity: 0, y: 20 }, visible: { opacity: 1, y: 0, transition: { duration: 0.4, ease: [0.25, 0.46, 0.45, 0.94], }, }, } return (
Choose Your Topics
setSearch(e.target.value)} /> Memuat data mentor... } > 0} fallback={ Tidak ada mentor ditemukan } > {(mentor, index) => ( )}
) } export default Components