feat: integrate sync status indicator into highlights panel
- Updated HighlightsTab to accept syncStatus and syncErrorMessage props - Added SyncStatusIndicator component import and display in highlights panel - Enhanced BibleReaderApp with sync status tracking state (synced/syncing/pending/error) - Modified performSync function to update sync status based on result - Updated VersDetailsPanel to pass sync status props through to HighlightsTab - Sync status now visible to users in the Highlights tab with real-time updates Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
'use client'
|
||||
import { Box, Button, Typography, Divider } from '@mui/material'
|
||||
import { BibleVerse, HighlightColor } from '@/types'
|
||||
import { SyncStatusIndicator } from './sync-status-indicator'
|
||||
|
||||
const HIGHLIGHT_COLORS: HighlightColor[] = ['yellow', 'orange', 'pink', 'blue']
|
||||
|
||||
@@ -17,6 +18,8 @@ interface HighlightsTabProps {
|
||||
currentColor: HighlightColor | null
|
||||
onToggleHighlight: () => void
|
||||
onColorChange: (color: HighlightColor) => void
|
||||
syncStatus?: 'synced' | 'syncing' | 'pending' | 'error'
|
||||
syncErrorMessage?: string
|
||||
}
|
||||
|
||||
export function HighlightsTab({
|
||||
@@ -24,7 +27,9 @@ export function HighlightsTab({
|
||||
isHighlighted,
|
||||
currentColor,
|
||||
onToggleHighlight,
|
||||
onColorChange
|
||||
onColorChange,
|
||||
syncStatus,
|
||||
syncErrorMessage
|
||||
}: HighlightsTabProps) {
|
||||
if (!verse) return null
|
||||
|
||||
@@ -80,6 +85,18 @@ export function HighlightsTab({
|
||||
|
||||
<Divider sx={{ my: 2 }} />
|
||||
|
||||
{syncStatus && (
|
||||
<Box sx={{ mt: 2 }}>
|
||||
<Typography variant="subtitle2" sx={{ mb: 1 }}>
|
||||
Sync Status
|
||||
</Typography>
|
||||
<SyncStatusIndicator
|
||||
status={syncStatus}
|
||||
errorMessage={syncErrorMessage}
|
||||
/>
|
||||
</Box>
|
||||
)}
|
||||
|
||||
<Typography variant="body2" color="textSecondary">
|
||||
You can highlight the same verse multiple times with different colors.
|
||||
</Typography>
|
||||
|
||||
Reference in New Issue
Block a user