mirror of
https://github.com/langgenius/dify.git
synced 2026-03-23 23:37:55 +08:00
Extract reusable hooks and sub-components from the DocumentList component to reduce complexity and improve testability: - useDocumentSort: handles sorting state and logic - useDocumentSelection: manages document selection state - useDocumentActions: handles batch actions with React Query mutations - DocumentTableRow: extracted table row component - SortHeader: reusable sort header component - DocumentSourceIcon: data source type icon renderer - renderTdValue: utility for displaying formatted values The main component remains in list.tsx with document-list/index.tsx providing a re-export for backwards compatibility. Test coverage: 156 tests covering all extracted modules. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>