1
1
import { type Statistic , statusesList } from "@allurereport/core-api" ;
2
+ import type { Signal } from "@preact/signals" ;
2
3
import { clsx } from "clsx" ;
3
4
import type { TreeFiltersState } from "global" ;
4
5
import { type FunctionComponent } from "preact" ;
5
6
import { ArrowButton } from "@/components/ArrowButton" ;
7
+ import type { StoreSignalState } from "@/components/Loadable" ;
6
8
import { Loadable } from "@/components/Loadable" ;
7
9
import { Text } from "@/components/Typography" ;
8
10
import styles from "./styles.scss" ;
@@ -12,7 +14,7 @@ interface TreeHeaderProps {
12
14
categoryTitle : string ;
13
15
isOpened : boolean ;
14
16
toggleTree : ( ) => void ;
15
- statsStore : any ;
17
+ statsStore : Signal < StoreSignalState < Statistic > > ;
16
18
treeFiltersStore : TreeFiltersState ;
17
19
}
18
20
@@ -50,10 +52,9 @@ export const TreeHeader: FunctionComponent<TreeHeaderProps> = ({
50
52
const treeHeaderBar = statistic
51
53
? statusesList
52
54
. map ( ( status ) => ( { status, value : statistic [ status ] } ) )
53
- . filter (
54
- ( { status, value } ) =>
55
- value !== undefined && ( statusFilter === "total" || ( statusFilter === status && value > 0 ) ) ,
56
- )
55
+ . filter ( ( { status, value } ) => {
56
+ return value !== undefined && ( statusFilter === "total" || ( statusFilter === status && value > 0 ) ) ;
57
+ } )
57
58
. map ( ( { status, value } ) => {
58
59
const className = clsx ( styles [ "tree-header-bar-item" ] , styles [ status ] ) ;
59
60
const style = { flexGrow : value } ;
0 commit comments