diff --git a/dashboard/src/features/entity-table/components/sidebar-entity-selection.tsx b/dashboard/src/features/entity-table/components/sidebar-entity-selection.tsx index 3104fd2..3796791 100644 --- a/dashboard/src/features/entity-table/components/sidebar-entity-selection.tsx +++ b/dashboard/src/features/entity-table/components/sidebar-entity-selection.tsx @@ -3,10 +3,12 @@ import { Table, TableHeader, TableRow, TableBody, TableHead, ScrollArea, Button, } from "@marzneshin/components"; +import { cn } from "@marzneshin/utils"; import { SidebarEntityCard, } from "@marzneshin/features/entity-table/components"; import { + useEntityTableContext, useSidebarEntityTableContext } from "@marzneshin/features/entity-table/contexts"; import { useTranslation } from "react-i18next"; @@ -16,8 +18,11 @@ export const SidebarEntitySelection = () => { sidebarEntityId, sidebarEntities, setSidebarEntityId, - sidebarCardProps + sidebarCardProps, } = useSidebarEntityTableContext() + const { table } = useEntityTableContext() + + const scrollBarHeight = table.getState().pagination.pageSize <= 10 ? "max-h-[45rem]" : "max-h-full" const { t } = useTranslation(); return ( @@ -43,7 +48,7 @@ export const SidebarEntitySelection = () => { onValueChange={(value) => setSidebarEntityId(value === "" ? undefined : value)} defaultValue={String(sidebarEntityId)} > - + {sidebarEntities.map((entity: any) => (