File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change 1+ import { useParams } from 'react-router' ;
12import { Tag } from '../tags/helpers/Tag' ;
23import type { ColorGenerator } from '../utils/services/ColorGenerator' ;
34import type { TagVisits } from './reducers/tagVisits' ;
@@ -9,11 +10,12 @@ interface TagVisitsHeaderProps {
910}
1011
1112export const TagVisitsHeader = ( { tagVisits, colorGenerator } : TagVisitsHeaderProps ) => {
12- const { tag, visits = [ ] } = tagVisits . status === 'loaded' ? tagVisits : { } ;
13+ const { tag : tagFromPath = '' } = useParams ( ) ;
14+ const { visits = [ ] , tag = tagFromPath } = tagVisits . status === 'loaded' ? tagVisits : { } ;
1315 const visitsStatsTitle = (
1416 < span className = "flex items-center justify-center" >
1517 < span className = "mr-2" > Visits for</ span >
16- { tag && < Tag text = { tag } colorGenerator = { colorGenerator } /> }
18+ < Tag text = { tag } colorGenerator = { colorGenerator } />
1719 </ span >
1820 ) ;
1921
You can’t perform that action at this time.
0 commit comments