mirror of
https://github.com/dergigi/boris.git
synced 2026-01-20 23:34:52 +01:00
refactor: extract components and utilities to keep files under 210 lines
- Extract types to src/types/bookmarks.ts - Extract utility functions to src/utils/bookmarkUtils.tsx - Extract BookmarkItem component to src/components/BookmarkItem.tsx - Extract BookmarkList component to src/components/BookmarkList.tsx - Extract bookmark fetching logic to src/services/bookmarkService.ts - Reduce main Bookmarks component from 416 to 100 lines - Maintain all functionality while improving code organization - Pass all linting and type checking
This commit is contained in:
43
src/types/bookmarks.ts
Normal file
43
src/types/bookmarks.ts
Normal file
@@ -0,0 +1,43 @@
|
||||
export interface ParsedNode {
|
||||
type: string
|
||||
value?: string
|
||||
url?: string
|
||||
encoded?: string
|
||||
children?: ParsedNode[]
|
||||
}
|
||||
|
||||
export interface ParsedContent {
|
||||
type: string
|
||||
children: ParsedNode[]
|
||||
}
|
||||
|
||||
export interface Bookmark {
|
||||
id: string
|
||||
title: string
|
||||
url: string
|
||||
content: string
|
||||
created_at: number
|
||||
tags: string[][]
|
||||
bookmarkCount?: number
|
||||
eventReferences?: string[]
|
||||
articleReferences?: string[]
|
||||
urlReferences?: string[]
|
||||
parsedContent?: ParsedContent
|
||||
individualBookmarks?: IndividualBookmark[]
|
||||
}
|
||||
|
||||
export interface IndividualBookmark {
|
||||
id: string
|
||||
content: string
|
||||
created_at: number
|
||||
pubkey: string
|
||||
kind: number
|
||||
tags: string[][]
|
||||
parsedContent?: ParsedContent
|
||||
author?: string
|
||||
type: 'event' | 'article'
|
||||
}
|
||||
|
||||
export interface ActiveAccount {
|
||||
pubkey: string
|
||||
}
|
||||
Reference in New Issue
Block a user