Skip to content

Commit 15f530e

Browse files
committed
fix: unnecessary calculation
1 parent 7e681a8 commit 15f530e

File tree

1 file changed

+10
-11
lines changed

1 file changed

+10
-11
lines changed

src/components/OperationList.tsx

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -30,24 +30,23 @@ export const OperationList: ComponentType<UseOperationsParams & { neoLayout?: bo
3030

3131
const { neoLayout = true } = props
3232

33-
let items: ReactNode = operationsWithDoc.map(({ operation, doc }) => (
34-
<OperationCard
35-
operation={operation}
36-
operationDoc={doc}
37-
key={operation.id}
38-
/>
39-
))
40-
if (neoLayout) {
41-
items = <div className='grid gap-4' style={{ gridTemplateColumns: "repeat(auto-fill, minmax(20rem, 1fr)" }}>
33+
const items: ReactNode = neoLayout ?
34+
<div className='grid gap-4' style={{ gridTemplateColumns: "repeat(auto-fill, minmax(20rem, 1fr)" }}>
4235
{operationsWithDoc.map(({ operation, doc }) => (
4336
<NeoOperationCard
4437
operation={operation}
4538
operationDoc={doc}
4639
key={operation.id}
4740
/>
4841
))}
49-
</div>
50-
}
42+
</div> :
43+
operationsWithDoc.map(({ operation, doc }) => (
44+
<OperationCard
45+
operation={operation}
46+
operationDoc={doc}
47+
key={operation.id}
48+
/>
49+
))
5150

5251
return (
5352
<>

0 commit comments

Comments
 (0)