mirror of
https://github.com/dergigi/boris.git
synced 2025-12-17 06:34:24 +01:00
feat: add refresh button to highlights sidebar header
Add a refresh button to the highlights panel header, positioned to the left of the eye icon. The button refreshes highlights for the current article and shows a spinning animation while loading.
This commit is contained in:
@@ -125,6 +125,8 @@ export const HighlightsPanel: React.FC<HighlightsPanelProps> = ({
|
||||
onToggleHighlights={handleToggleHighlights}
|
||||
onToggleCollapse={onToggleCollapse}
|
||||
onHighlightVisibilityChange={onHighlightVisibilityChange}
|
||||
onRefresh={onRefresh}
|
||||
isLoading={loading}
|
||||
isMobile={isMobile}
|
||||
/>
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import React from 'react'
|
||||
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
|
||||
import { faChevronRight, faEye, faEyeSlash, faUser, faUserGroup, faNetworkWired } from '@fortawesome/free-solid-svg-icons'
|
||||
import { faChevronRight, faEye, faEyeSlash, faUser, faUserGroup, faNetworkWired, faArrowsRotate } from '@fortawesome/free-solid-svg-icons'
|
||||
import { HighlightVisibility } from '../HighlightsPanel'
|
||||
import IconButton from '../IconButton'
|
||||
|
||||
@@ -12,6 +12,8 @@ interface HighlightsPanelHeaderProps {
|
||||
onToggleHighlights: () => void
|
||||
onToggleCollapse: () => void
|
||||
onHighlightVisibilityChange?: (visibility: HighlightVisibility) => void
|
||||
onRefresh?: () => void
|
||||
isLoading?: boolean
|
||||
isMobile?: boolean
|
||||
}
|
||||
|
||||
@@ -23,6 +25,8 @@ const HighlightsPanelHeader: React.FC<HighlightsPanelHeaderProps> = ({
|
||||
onToggleHighlights,
|
||||
onToggleCollapse,
|
||||
onHighlightVisibilityChange,
|
||||
onRefresh,
|
||||
isLoading = false,
|
||||
isMobile = false
|
||||
}) => {
|
||||
return (
|
||||
@@ -91,6 +95,17 @@ const HighlightsPanelHeader: React.FC<HighlightsPanelHeaderProps> = ({
|
||||
)}
|
||||
</div>
|
||||
<div className="highlights-actions-right">
|
||||
{onRefresh && (
|
||||
<IconButton
|
||||
icon={faArrowsRotate}
|
||||
onClick={onRefresh}
|
||||
title="Refresh highlights"
|
||||
ariaLabel="Refresh highlights"
|
||||
variant="ghost"
|
||||
disabled={isLoading}
|
||||
spin={isLoading}
|
||||
/>
|
||||
)}
|
||||
{hasHighlights && (
|
||||
<IconButton
|
||||
icon={showHighlights ? faEye : faEyeSlash}
|
||||
|
||||
Reference in New Issue
Block a user