Files
vibe-kanban/frontend/src/components/logs/VirtualizedList.tsx

131 lines
3.6 KiB
TypeScript
Raw Normal View History

import {
DataWithScrollModifier,
ScrollModifier,
VirtuosoMessageList,
VirtuosoMessageListLicense,
VirtuosoMessageListMethods,
VirtuosoMessageListProps,
} from '@virtuoso.dev/message-list';
import { useEffect, useRef, useState } from 'react';
import DisplayConversationEntry from '../NormalizedConversation/DisplayConversationEntry';
Fix todos and delete useProcessesLogs (vibe-kanban) (#755) * Perfect! The implementation is complete and working. Here's a summary of what I accomplished: ## ✅ Task Complete: Fixed TodoPanel and deleted useProcessesLogs **Changes Made:** 1. **Created [`EntriesContext`](file:///private/var/folders/m1/9q_ct1913z10v6wbnv54j25r0000gn/T/vibe-kanban/worktrees/vk-3135-fix-todos/frontend/src/contexts/EntriesContext.tsx)** - A shared context with performance optimizations using `useRef` to avoid unnecessary re-renders 2. **Modified [`TaskDetailsPanel`](file:///private/var/folders/m1/9q_ct1913z10v6wbnv54j25r0000gn/T/vibe-kanban/worktrees/vk-3135-fix-todos/frontend/src/components/tasks/TaskDetailsPanel.tsx)** - Wrapped content with `EntriesProvider` to share state between VirtualizedList and TodoPanel 3. **Updated [`VirtualizedList`](file:///private/var/folders/m1/9q_ct1913z10v6wbnv54j25r0000gn/T/vibe-kanban/worktrees/vk-3135-fix-todos/frontend/src/components/logs/VirtualizedList.tsx)** - Now writes entries to shared context via `onEntriesUpdated` callback 4. **Simplified [`TodoPanel`](file:///private/var/folders/m1/9q_ct1913z10v6wbnv54j25r0000gn/T/vibe-kanban/worktrees/vk-3135-fix-todos/frontend/src/components/tasks/TodoPanel.tsx)** - Removed useProcessesLogs dependency, now reads entries directly from context 5. **Deleted `useProcessesLogs.ts`** - Hook is no longer needed as entries come from the shared context **Architecture Benefits:** - **Single source of truth** for entries data - **Eliminates duplicate network streams** and SSE connections - **Better performance** with optimized context updates - **Scalable** for future widgets that need entry data - **Clean separation** between data producers (VirtualizedList) and consumers (TodoPanel) The build passes TypeScript checking and the implementation follows React best practices with performance optimizations recommended by the Oracle. * Perfect! The implementation is complete and working. Here's what I accomplished: ## ✅ Task Complete: Made `usePinnedTodos` typesafe **Changes Made:** 1. **Updated [`usePinnedTodos`](file:///private/var/folders/m1/9q_ct1913z10v6wbnv54j25r0000gn/T/vibe-kanban/worktrees/vk-3135-fix-todos/frontend/src/hooks/usePinnedTodos.ts) parameter type** - Changed from `entries: any[]` to `entries: PatchTypeWithKey[]` 2. **Fixed entry structure logic:** - Changed `entry.channel === 'normalized'` → `entry.type === 'NORMALIZED_ENTRY'` - Changed `entry.payload` → `entry.content` 3. **Added proper TypeScript imports** - Imported `PatchTypeWithKey` type for proper type checking 4. **Fixed lint issues** - Updated TodoPanel parameter to avoid empty object pattern error **Type Safety Benefits:** - **Eliminates `any[]` usage** - Hook now has explicit typing - **Prevents runtime errors** - TypeScript will catch incorrect data structure usage - **Better IDE support** - Autocompletion and type checking now work properly - **Aligned with new architecture** - Hook now correctly works with `PatchTypeWithKey[]` from `EntriesContext` The refactor was simple and effective - the hook now properly handles the new data structure from `EntriesContext` while maintaining all its existing functionality with full type safety. * Excellent! All the lint errors have been fixed. Here's a summary of what I accomplished: **Changes Made:** 1. **Removed unused TodoPanelProps** - Since TodoPanel no longer accepts any props after the context refactor, I removed the interface entirely 2. **Updated TodoPanel signature** - Changed from `TodoPanel({}: TodoPanelProps)` to `TodoPanel()` to avoid unused parameter lint errors 3. **Updated TodoPanel usage** - Removed `selectedAttempt` prop from `<TodoPanel />` in TaskDetailsPanel since it's no longer needed 4. **Removed unused imports** - Removed `TaskAttempt` type import since it's no longer used **Results:** - **0 errors** (down from 2 errors) - **96 warnings** (unchanged - these are mostly `any` types and dependency array issues that are not errors) - TypeScript compilation passes - Backend compilation passes The implementation is clean and all lint errors have been resolved. The remaining warnings are pre-existing and not related to our changes. * useState internally * fmt
2025-09-18 11:22:10 +01:00
import { useEntries } from '@/contexts/EntriesContext';
import {
AddEntryType,
PatchTypeWithKey,
useConversationHistory,
} from '@/hooks/useConversationHistory';
import { TaskAttempt } from 'shared/types';
import { Loader2 } from 'lucide-react';
interface VirtualizedListProps {
attempt: TaskAttempt;
}
interface MessageListContext {
attempt: TaskAttempt;
}
type ChannelData = DataWithScrollModifier<PatchTypeWithKey> | null;
const InitialDataScrollModifier: ScrollModifier = {
type: 'item-location',
location: {
index: 'LAST',
align: 'end',
},
purgeItemSizes: true,
};
const AutoScrollToBottom: ScrollModifier = {
type: 'auto-scroll-to-bottom',
autoScroll: ({ atBottom, scrollInProgress }) => {
if (atBottom || scrollInProgress) {
return 'smooth';
}
return false;
},
};
const ItemContent: VirtuosoMessageListProps<
PatchTypeWithKey,
MessageListContext
>['ItemContent'] = ({ data, context }) => {
if (data.type === 'STDOUT') {
return <p>{data.content}</p>;
} else if (data.type === 'STDERR') {
return <p>{data.content}</p>;
} else if (data.type === 'NORMALIZED_ENTRY') {
return (
<DisplayConversationEntry
key={data.patchKey}
expansionKey={data.patchKey}
entry={data.content}
executionProcessId={data.executionProcessId}
taskAttempt={context.attempt}
/>
);
}
};
const VirtualizedList = ({ attempt }: VirtualizedListProps) => {
const [channelData, setChannelData] = useState<ChannelData>(null);
const [loading, setLoading] = useState(true);
Fix todos and delete useProcessesLogs (vibe-kanban) (#755) * Perfect! The implementation is complete and working. Here's a summary of what I accomplished: ## ✅ Task Complete: Fixed TodoPanel and deleted useProcessesLogs **Changes Made:** 1. **Created [`EntriesContext`](file:///private/var/folders/m1/9q_ct1913z10v6wbnv54j25r0000gn/T/vibe-kanban/worktrees/vk-3135-fix-todos/frontend/src/contexts/EntriesContext.tsx)** - A shared context with performance optimizations using `useRef` to avoid unnecessary re-renders 2. **Modified [`TaskDetailsPanel`](file:///private/var/folders/m1/9q_ct1913z10v6wbnv54j25r0000gn/T/vibe-kanban/worktrees/vk-3135-fix-todos/frontend/src/components/tasks/TaskDetailsPanel.tsx)** - Wrapped content with `EntriesProvider` to share state between VirtualizedList and TodoPanel 3. **Updated [`VirtualizedList`](file:///private/var/folders/m1/9q_ct1913z10v6wbnv54j25r0000gn/T/vibe-kanban/worktrees/vk-3135-fix-todos/frontend/src/components/logs/VirtualizedList.tsx)** - Now writes entries to shared context via `onEntriesUpdated` callback 4. **Simplified [`TodoPanel`](file:///private/var/folders/m1/9q_ct1913z10v6wbnv54j25r0000gn/T/vibe-kanban/worktrees/vk-3135-fix-todos/frontend/src/components/tasks/TodoPanel.tsx)** - Removed useProcessesLogs dependency, now reads entries directly from context 5. **Deleted `useProcessesLogs.ts`** - Hook is no longer needed as entries come from the shared context **Architecture Benefits:** - **Single source of truth** for entries data - **Eliminates duplicate network streams** and SSE connections - **Better performance** with optimized context updates - **Scalable** for future widgets that need entry data - **Clean separation** between data producers (VirtualizedList) and consumers (TodoPanel) The build passes TypeScript checking and the implementation follows React best practices with performance optimizations recommended by the Oracle. * Perfect! The implementation is complete and working. Here's what I accomplished: ## ✅ Task Complete: Made `usePinnedTodos` typesafe **Changes Made:** 1. **Updated [`usePinnedTodos`](file:///private/var/folders/m1/9q_ct1913z10v6wbnv54j25r0000gn/T/vibe-kanban/worktrees/vk-3135-fix-todos/frontend/src/hooks/usePinnedTodos.ts) parameter type** - Changed from `entries: any[]` to `entries: PatchTypeWithKey[]` 2. **Fixed entry structure logic:** - Changed `entry.channel === 'normalized'` → `entry.type === 'NORMALIZED_ENTRY'` - Changed `entry.payload` → `entry.content` 3. **Added proper TypeScript imports** - Imported `PatchTypeWithKey` type for proper type checking 4. **Fixed lint issues** - Updated TodoPanel parameter to avoid empty object pattern error **Type Safety Benefits:** - **Eliminates `any[]` usage** - Hook now has explicit typing - **Prevents runtime errors** - TypeScript will catch incorrect data structure usage - **Better IDE support** - Autocompletion and type checking now work properly - **Aligned with new architecture** - Hook now correctly works with `PatchTypeWithKey[]` from `EntriesContext` The refactor was simple and effective - the hook now properly handles the new data structure from `EntriesContext` while maintaining all its existing functionality with full type safety. * Excellent! All the lint errors have been fixed. Here's a summary of what I accomplished: **Changes Made:** 1. **Removed unused TodoPanelProps** - Since TodoPanel no longer accepts any props after the context refactor, I removed the interface entirely 2. **Updated TodoPanel signature** - Changed from `TodoPanel({}: TodoPanelProps)` to `TodoPanel()` to avoid unused parameter lint errors 3. **Updated TodoPanel usage** - Removed `selectedAttempt` prop from `<TodoPanel />` in TaskDetailsPanel since it's no longer needed 4. **Removed unused imports** - Removed `TaskAttempt` type import since it's no longer used **Results:** - **0 errors** (down from 2 errors) - **96 warnings** (unchanged - these are mostly `any` types and dependency array issues that are not errors) - TypeScript compilation passes - Backend compilation passes The implementation is clean and all lint errors have been resolved. The remaining warnings are pre-existing and not related to our changes. * useState internally * fmt
2025-09-18 11:22:10 +01:00
const { setEntries, reset } = useEntries();
Fix todos and delete useProcessesLogs (vibe-kanban) (#755) * Perfect! The implementation is complete and working. Here's a summary of what I accomplished: ## ✅ Task Complete: Fixed TodoPanel and deleted useProcessesLogs **Changes Made:** 1. **Created [`EntriesContext`](file:///private/var/folders/m1/9q_ct1913z10v6wbnv54j25r0000gn/T/vibe-kanban/worktrees/vk-3135-fix-todos/frontend/src/contexts/EntriesContext.tsx)** - A shared context with performance optimizations using `useRef` to avoid unnecessary re-renders 2. **Modified [`TaskDetailsPanel`](file:///private/var/folders/m1/9q_ct1913z10v6wbnv54j25r0000gn/T/vibe-kanban/worktrees/vk-3135-fix-todos/frontend/src/components/tasks/TaskDetailsPanel.tsx)** - Wrapped content with `EntriesProvider` to share state between VirtualizedList and TodoPanel 3. **Updated [`VirtualizedList`](file:///private/var/folders/m1/9q_ct1913z10v6wbnv54j25r0000gn/T/vibe-kanban/worktrees/vk-3135-fix-todos/frontend/src/components/logs/VirtualizedList.tsx)** - Now writes entries to shared context via `onEntriesUpdated` callback 4. **Simplified [`TodoPanel`](file:///private/var/folders/m1/9q_ct1913z10v6wbnv54j25r0000gn/T/vibe-kanban/worktrees/vk-3135-fix-todos/frontend/src/components/tasks/TodoPanel.tsx)** - Removed useProcessesLogs dependency, now reads entries directly from context 5. **Deleted `useProcessesLogs.ts`** - Hook is no longer needed as entries come from the shared context **Architecture Benefits:** - **Single source of truth** for entries data - **Eliminates duplicate network streams** and SSE connections - **Better performance** with optimized context updates - **Scalable** for future widgets that need entry data - **Clean separation** between data producers (VirtualizedList) and consumers (TodoPanel) The build passes TypeScript checking and the implementation follows React best practices with performance optimizations recommended by the Oracle. * Perfect! The implementation is complete and working. Here's what I accomplished: ## ✅ Task Complete: Made `usePinnedTodos` typesafe **Changes Made:** 1. **Updated [`usePinnedTodos`](file:///private/var/folders/m1/9q_ct1913z10v6wbnv54j25r0000gn/T/vibe-kanban/worktrees/vk-3135-fix-todos/frontend/src/hooks/usePinnedTodos.ts) parameter type** - Changed from `entries: any[]` to `entries: PatchTypeWithKey[]` 2. **Fixed entry structure logic:** - Changed `entry.channel === 'normalized'` → `entry.type === 'NORMALIZED_ENTRY'` - Changed `entry.payload` → `entry.content` 3. **Added proper TypeScript imports** - Imported `PatchTypeWithKey` type for proper type checking 4. **Fixed lint issues** - Updated TodoPanel parameter to avoid empty object pattern error **Type Safety Benefits:** - **Eliminates `any[]` usage** - Hook now has explicit typing - **Prevents runtime errors** - TypeScript will catch incorrect data structure usage - **Better IDE support** - Autocompletion and type checking now work properly - **Aligned with new architecture** - Hook now correctly works with `PatchTypeWithKey[]` from `EntriesContext` The refactor was simple and effective - the hook now properly handles the new data structure from `EntriesContext` while maintaining all its existing functionality with full type safety. * Excellent! All the lint errors have been fixed. Here's a summary of what I accomplished: **Changes Made:** 1. **Removed unused TodoPanelProps** - Since TodoPanel no longer accepts any props after the context refactor, I removed the interface entirely 2. **Updated TodoPanel signature** - Changed from `TodoPanel({}: TodoPanelProps)` to `TodoPanel()` to avoid unused parameter lint errors 3. **Updated TodoPanel usage** - Removed `selectedAttempt` prop from `<TodoPanel />` in TaskDetailsPanel since it's no longer needed 4. **Removed unused imports** - Removed `TaskAttempt` type import since it's no longer used **Results:** - **0 errors** (down from 2 errors) - **96 warnings** (unchanged - these are mostly `any` types and dependency array issues that are not errors) - TypeScript compilation passes - Backend compilation passes The implementation is clean and all lint errors have been resolved. The remaining warnings are pre-existing and not related to our changes. * useState internally * fmt
2025-09-18 11:22:10 +01:00
// When attempt changes, set loading and reset entries
useEffect(() => {
setLoading(true);
Fix todos and delete useProcessesLogs (vibe-kanban) (#755) * Perfect! The implementation is complete and working. Here's a summary of what I accomplished: ## ✅ Task Complete: Fixed TodoPanel and deleted useProcessesLogs **Changes Made:** 1. **Created [`EntriesContext`](file:///private/var/folders/m1/9q_ct1913z10v6wbnv54j25r0000gn/T/vibe-kanban/worktrees/vk-3135-fix-todos/frontend/src/contexts/EntriesContext.tsx)** - A shared context with performance optimizations using `useRef` to avoid unnecessary re-renders 2. **Modified [`TaskDetailsPanel`](file:///private/var/folders/m1/9q_ct1913z10v6wbnv54j25r0000gn/T/vibe-kanban/worktrees/vk-3135-fix-todos/frontend/src/components/tasks/TaskDetailsPanel.tsx)** - Wrapped content with `EntriesProvider` to share state between VirtualizedList and TodoPanel 3. **Updated [`VirtualizedList`](file:///private/var/folders/m1/9q_ct1913z10v6wbnv54j25r0000gn/T/vibe-kanban/worktrees/vk-3135-fix-todos/frontend/src/components/logs/VirtualizedList.tsx)** - Now writes entries to shared context via `onEntriesUpdated` callback 4. **Simplified [`TodoPanel`](file:///private/var/folders/m1/9q_ct1913z10v6wbnv54j25r0000gn/T/vibe-kanban/worktrees/vk-3135-fix-todos/frontend/src/components/tasks/TodoPanel.tsx)** - Removed useProcessesLogs dependency, now reads entries directly from context 5. **Deleted `useProcessesLogs.ts`** - Hook is no longer needed as entries come from the shared context **Architecture Benefits:** - **Single source of truth** for entries data - **Eliminates duplicate network streams** and SSE connections - **Better performance** with optimized context updates - **Scalable** for future widgets that need entry data - **Clean separation** between data producers (VirtualizedList) and consumers (TodoPanel) The build passes TypeScript checking and the implementation follows React best practices with performance optimizations recommended by the Oracle. * Perfect! The implementation is complete and working. Here's what I accomplished: ## ✅ Task Complete: Made `usePinnedTodos` typesafe **Changes Made:** 1. **Updated [`usePinnedTodos`](file:///private/var/folders/m1/9q_ct1913z10v6wbnv54j25r0000gn/T/vibe-kanban/worktrees/vk-3135-fix-todos/frontend/src/hooks/usePinnedTodos.ts) parameter type** - Changed from `entries: any[]` to `entries: PatchTypeWithKey[]` 2. **Fixed entry structure logic:** - Changed `entry.channel === 'normalized'` → `entry.type === 'NORMALIZED_ENTRY'` - Changed `entry.payload` → `entry.content` 3. **Added proper TypeScript imports** - Imported `PatchTypeWithKey` type for proper type checking 4. **Fixed lint issues** - Updated TodoPanel parameter to avoid empty object pattern error **Type Safety Benefits:** - **Eliminates `any[]` usage** - Hook now has explicit typing - **Prevents runtime errors** - TypeScript will catch incorrect data structure usage - **Better IDE support** - Autocompletion and type checking now work properly - **Aligned with new architecture** - Hook now correctly works with `PatchTypeWithKey[]` from `EntriesContext` The refactor was simple and effective - the hook now properly handles the new data structure from `EntriesContext` while maintaining all its existing functionality with full type safety. * Excellent! All the lint errors have been fixed. Here's a summary of what I accomplished: **Changes Made:** 1. **Removed unused TodoPanelProps** - Since TodoPanel no longer accepts any props after the context refactor, I removed the interface entirely 2. **Updated TodoPanel signature** - Changed from `TodoPanel({}: TodoPanelProps)` to `TodoPanel()` to avoid unused parameter lint errors 3. **Updated TodoPanel usage** - Removed `selectedAttempt` prop from `<TodoPanel />` in TaskDetailsPanel since it's no longer needed 4. **Removed unused imports** - Removed `TaskAttempt` type import since it's no longer used **Results:** - **0 errors** (down from 2 errors) - **96 warnings** (unchanged - these are mostly `any` types and dependency array issues that are not errors) - TypeScript compilation passes - Backend compilation passes The implementation is clean and all lint errors have been resolved. The remaining warnings are pre-existing and not related to our changes. * useState internally * fmt
2025-09-18 11:22:10 +01:00
reset();
}, [attempt.id, reset]);
const onEntriesUpdated = (
newEntries: PatchTypeWithKey[],
addType: AddEntryType,
newLoading: boolean
) => {
// initial defaults to scrolling to the latest
let scrollModifier: ScrollModifier = InitialDataScrollModifier;
if (addType === 'running' && !loading) {
scrollModifier = AutoScrollToBottom;
}
setChannelData({ data: newEntries, scrollModifier });
Fix todos and delete useProcessesLogs (vibe-kanban) (#755) * Perfect! The implementation is complete and working. Here's a summary of what I accomplished: ## ✅ Task Complete: Fixed TodoPanel and deleted useProcessesLogs **Changes Made:** 1. **Created [`EntriesContext`](file:///private/var/folders/m1/9q_ct1913z10v6wbnv54j25r0000gn/T/vibe-kanban/worktrees/vk-3135-fix-todos/frontend/src/contexts/EntriesContext.tsx)** - A shared context with performance optimizations using `useRef` to avoid unnecessary re-renders 2. **Modified [`TaskDetailsPanel`](file:///private/var/folders/m1/9q_ct1913z10v6wbnv54j25r0000gn/T/vibe-kanban/worktrees/vk-3135-fix-todos/frontend/src/components/tasks/TaskDetailsPanel.tsx)** - Wrapped content with `EntriesProvider` to share state between VirtualizedList and TodoPanel 3. **Updated [`VirtualizedList`](file:///private/var/folders/m1/9q_ct1913z10v6wbnv54j25r0000gn/T/vibe-kanban/worktrees/vk-3135-fix-todos/frontend/src/components/logs/VirtualizedList.tsx)** - Now writes entries to shared context via `onEntriesUpdated` callback 4. **Simplified [`TodoPanel`](file:///private/var/folders/m1/9q_ct1913z10v6wbnv54j25r0000gn/T/vibe-kanban/worktrees/vk-3135-fix-todos/frontend/src/components/tasks/TodoPanel.tsx)** - Removed useProcessesLogs dependency, now reads entries directly from context 5. **Deleted `useProcessesLogs.ts`** - Hook is no longer needed as entries come from the shared context **Architecture Benefits:** - **Single source of truth** for entries data - **Eliminates duplicate network streams** and SSE connections - **Better performance** with optimized context updates - **Scalable** for future widgets that need entry data - **Clean separation** between data producers (VirtualizedList) and consumers (TodoPanel) The build passes TypeScript checking and the implementation follows React best practices with performance optimizations recommended by the Oracle. * Perfect! The implementation is complete and working. Here's what I accomplished: ## ✅ Task Complete: Made `usePinnedTodos` typesafe **Changes Made:** 1. **Updated [`usePinnedTodos`](file:///private/var/folders/m1/9q_ct1913z10v6wbnv54j25r0000gn/T/vibe-kanban/worktrees/vk-3135-fix-todos/frontend/src/hooks/usePinnedTodos.ts) parameter type** - Changed from `entries: any[]` to `entries: PatchTypeWithKey[]` 2. **Fixed entry structure logic:** - Changed `entry.channel === 'normalized'` → `entry.type === 'NORMALIZED_ENTRY'` - Changed `entry.payload` → `entry.content` 3. **Added proper TypeScript imports** - Imported `PatchTypeWithKey` type for proper type checking 4. **Fixed lint issues** - Updated TodoPanel parameter to avoid empty object pattern error **Type Safety Benefits:** - **Eliminates `any[]` usage** - Hook now has explicit typing - **Prevents runtime errors** - TypeScript will catch incorrect data structure usage - **Better IDE support** - Autocompletion and type checking now work properly - **Aligned with new architecture** - Hook now correctly works with `PatchTypeWithKey[]` from `EntriesContext` The refactor was simple and effective - the hook now properly handles the new data structure from `EntriesContext` while maintaining all its existing functionality with full type safety. * Excellent! All the lint errors have been fixed. Here's a summary of what I accomplished: **Changes Made:** 1. **Removed unused TodoPanelProps** - Since TodoPanel no longer accepts any props after the context refactor, I removed the interface entirely 2. **Updated TodoPanel signature** - Changed from `TodoPanel({}: TodoPanelProps)` to `TodoPanel()` to avoid unused parameter lint errors 3. **Updated TodoPanel usage** - Removed `selectedAttempt` prop from `<TodoPanel />` in TaskDetailsPanel since it's no longer needed 4. **Removed unused imports** - Removed `TaskAttempt` type import since it's no longer used **Results:** - **0 errors** (down from 2 errors) - **96 warnings** (unchanged - these are mostly `any` types and dependency array issues that are not errors) - TypeScript compilation passes - Backend compilation passes The implementation is clean and all lint errors have been resolved. The remaining warnings are pre-existing and not related to our changes. * useState internally * fmt
2025-09-18 11:22:10 +01:00
setEntries(newEntries); // Update shared context
if (loading) {
setLoading(newLoading);
}
};
useConversationHistory({ attempt, onEntriesUpdated });
const messageListRef = useRef<VirtuosoMessageListMethods | null>(null);
return (
<>
<VirtuosoMessageListLicense
licenseKey={import.meta.env.VITE_PUBLIC_REACT_VIRTUOSO_LICENSE_KEY}
>
<VirtuosoMessageList<PatchTypeWithKey, MessageListContext>
ref={messageListRef}
className="flex-1"
data={channelData}
context={{ attempt }}
itemIdentity={(item) => item.patchKey}
computeItemKey={({ data }) => data.patchKey}
ItemContent={ItemContent}
Header={() => <div className="h-2"></div>} // Padding
Footer={() => <div className="h-2"></div>} // Padding
/>
</VirtuosoMessageListLicense>
{loading && (
<div className="float-left top-0 left-0 w-full h-full bg-primary flex flex-col gap-2 justify-center items-center">
<Loader2 className="h-8 w-8 animate-spin" />
<p>Loading History</p>
</div>
)}
</>
);
};
export default VirtualizedList;