Skip to content

Commit c931a84

Browse files
committed
Fix linting
1 parent bb2d36d commit c931a84

File tree

2 files changed

+28
-31
lines changed

2 files changed

+28
-31
lines changed

components/search/common.tsx

Lines changed: 26 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -29,33 +29,30 @@ export function getServerConfig(): TypesenseInstantsearchAdapterOptions["server"
2929
}
3030
}
3131

32+
function RefinementList({ attribute }: { attribute: string }) {
33+
useRefinementList({ attribute })
34+
return null
35+
}
3236

33-
export function VirtualFilters({ type }: { type: 'bill' | 'testimony' }) {
34-
let refinementAttributes;
35-
36-
if (type === 'testimony') {
37-
refinementAttributes = [
38-
'authorDisplayName',
39-
'court',
40-
'position',
41-
'billId',
42-
'authorRole'
43-
];
44-
} else if (type === 'bill') {
45-
refinementAttributes = [
46-
'court',
47-
'currentCommittee',
48-
'city',
49-
'primarySponsor',
50-
'cosponsors',
51-
'topics.lvl0',
52-
'topics.lvl1',
53-
];
54-
}
55-
56-
refinementAttributes?.forEach((attribute) => {
57-
useRefinementList({ attribute });
58-
});
59-
60-
return null;
61-
}
37+
export function VirtualFilters({ type }: { type: "bill" | "testimony" }) {
38+
const refinementAttributes =
39+
type === "testimony"
40+
? ["authorDisplayName", "court", "position", "billId", "authorRole"]
41+
: [
42+
"court",
43+
"currentCommittee",
44+
"city",
45+
"primarySponsor",
46+
"cosponsors",
47+
"topics.lvl0",
48+
"topics.lvl1"
49+
]
50+
51+
return (
52+
<>
53+
{refinementAttributes.map(attribute => (
54+
<RefinementList key={attribute} attribute={attribute} />
55+
))}
56+
</>
57+
)
58+
}

components/search/testimony/TestimonySearch.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,8 @@ const Layout = () => {
109109
t === "Individuals"
110110
? ["user"]
111111
: t === "Organizations"
112-
? ["organization"]
113-
: validRoles
112+
? ["organization"]
113+
: validRoles
114114
return {
115115
...prevState,
116116
refinementList: {

0 commit comments

Comments
 (0)