mirror of
https://github.com/community-scripts/ProxmoxVE
synced 2025-02-11 10:19:16 +00:00
Refactor MostViewedScripts to ensure proper type annotations and improve array concatenation method for better readability
This commit is contained in:
parent
2169131863
commit
306fd8e26c
@ -136,13 +136,12 @@ export function LatestScripts({ items }: { items: Category[] }) {
|
||||
}
|
||||
|
||||
export function MostViewedScripts({ items }: { items: Category[] }) {
|
||||
const mostViewedScripts = items.reduce((acc, category) => {
|
||||
const mostViewedScripts = items.reduce((acc: Script[], category) => {
|
||||
const foundScripts = category.scripts.filter((script) =>
|
||||
mostPopularScripts.includes(script.name),
|
||||
);
|
||||
acc.push(...foundScripts);
|
||||
return acc;
|
||||
}, [] as Script[]);
|
||||
return acc.concat(foundScripts);
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<div className="">
|
||||
|
Loading…
Reference in New Issue
Block a user