- {viewMode === 'grid' ? (
- <>
-
-
- >
- ) : null}
+
+
+ {Array.from({ length: 12 }).map((_, index) => (
+
))}
);
}
+
+function ListSkeleton() {
+ return (
+
+
+
+ {Array.from({ length: 10 }).map((_, index) => (
+
+ ))}
+
+
+ );
+}
+
+function ColumnsSkeleton() {
+ return (
+
+
+
+
+ {Array.from({ length: 11 }).map((_, rowIndex) => (
+
+ ))}
+
+
+
+
+ );
+}
+
+function GallerySkeleton() {
+ return (
+
+
+
+
+ {Array.from({ length: 10 }).map((_, index) => (
+
+ ))}
+
+
+
+ );
+}
+
+export function DocumentListSkeleton({
+ viewMode = 'icons',
+ iconSize = 'md',
+}: DocumentListSkeletonProps) {
+ let body;
+ if (viewMode === 'list') {
+ body =
;
+ } else if (viewMode === 'columns') {
+ body =
;
+ } else if (viewMode === 'gallery') {
+ body =
;
+ } else {
+ body =
;
+ }
+
+ return (
+
+ {body}
+
+ );
+}
diff --git a/src/components/doclist/views/ColumnsView.tsx b/src/components/doclist/views/ColumnsView.tsx
index 507278d..67b87ce 100644
--- a/src/components/doclist/views/ColumnsView.tsx
+++ b/src/components/doclist/views/ColumnsView.tsx
@@ -1,7 +1,7 @@
'use client';
import Link from 'next/link';
-import { useEffect, useState } from 'react';
+import { useEffect, useMemo, useState } from 'react';
import { useDrag, useDrop } from 'react-dnd';
import type { DocumentListDocument, Folder } from '@/types/documents';
import { PDFIcon, EPUBIcon, FileIcon } from '@/components/icons/Icons';
@@ -74,15 +74,17 @@ function ColumnDocRow({
data-doc-tile
onClick={onClick}
className={
- 'flex items-center gap-2 px-2 py-1.5 rounded-md text-[12px] transition-colors duration-200 ease-out cursor-pointer ' +
+ 'group flex items-center gap-2 px-2 py-1 rounded-md text-[12px] border transform transition-all duration-200 ease-out cursor-pointer text-left hover:scale-[1.01] ' +
(active || isSelected
- ? 'bg-accent text-background'
- : 'text-foreground hover:bg-offbase') +
+ ? 'border-accent bg-offbase text-accent'
+ : 'border-transparent text-foreground hover:border-accent hover:bg-offbase hover:text-accent') +
(isOver && canDrop ? ' ring-1 ring-accent' : '') +
(isDragging ? ' opacity-50' : '')
}
>
-
+
+
+
{doc.name}
);
@@ -111,19 +113,19 @@ function ColumnFolderRow({
ref={dropRef as unknown as React.RefObject