- {activeTab === 'drafts' && (
- <>
- {isLoading && user ? (
-
- ) : totalDrafts === 0 ? (
-
-
-
-
-
No drafts yet
-
- Your saved drafts will appear here
-
-
-
- ) : (
-
- {combinedDrafts.map((draft) => (
-
handleSelectDraft(draft)}
- >
-
-
-
- {draft.title || 'Untitled Draft'}
-
- {draft.summary && (
-
- {draft.summary}
-
- )}
-
-
-
-
- {draft.isLocal ? (
-
- ) : (
-
- )}
-
-
- {formatDistanceToNow(draft.updatedAt, { addSuffix: true })}
-
- {draft.tags.length > 0 && (
- <>
- ·
- {draft.tags.length} tags
- >
- )}
-
-
-
-
- ))}
-
- )}
- >
- )}
-
- {activeTab === 'published' && (
- <>
- {isLoadingArticles && user ? (
-
-
-
Loading articles...
-
- ) : !user ? (
-
-
-
-
-
Sign in to see your articles
-
- Your published articles will appear here
-
-
- ) : publishedArticles.length === 0 ? (
-
-
-
-
-
No published articles yet
-
- Your published articles will appear here
-
-
- ) : (
-
- {publishedArticles.map((article) => (
-
handleSelectArticle(article)}
- >
-
-
-
- {article.title || 'Untitled Article'}
-
-
-
- {article.summary && (
-
- {article.summary}
-
- )}
-
-
-
- Published{' '}
- {formatDistanceToNow(article.publishedAt, {
- addSuffix: true,
- })}
-
- {article.tags.length > 0 && (
- <>
- ·
- {article.tags.length} tags
- >
- )}
-
-
-
-
-
-
-
- ))}
-
- )}
- >
- )}
-
-
-