"use client";
import { Node } from '@/types/database';
import { getNodeIcon } from '@/utils/nodeIcons';
import { useDimensionIcons } from '@/context/DimensionIconsContext';
interface ListViewProps {
nodes: Node[];
onNodeClick: (nodeId: number) => void;
}
export default function ListView({ nodes, onNodeClick }: ListViewProps) {
const { dimensionIcons } = useDimensionIcons();
const formatDate = (dateString?: string) => {
if (!dateString) return '';
const date = new Date(dateString);
return date.toLocaleDateString('en-US', {
month: 'short',
day: 'numeric',
year: 'numeric'
});
};
const truncateContent = (content?: string, maxLength: number = 100) => {
if (!content) return '';
if (content.length <= maxLength) return content;
return content.substring(0, maxLength) + '...';
};
if (nodes.length === 0) {
return (
No nodes match the current filters
);
}
return (
{nodes.map(node => (
))}
);
}