More typing and fixes
This commit is contained in:
@@ -1,8 +1,9 @@
|
||||
import { Divider, Group } from '@mantine/core';
|
||||
import { useCommonHooks } from 'hooks';
|
||||
import type { SearchShortcut } from 'types';
|
||||
import HintItem from './HintItem';
|
||||
|
||||
function HelpSection({ name, items }: { name: string; items: object[] }) {
|
||||
function HelpSection({ name, items }: { name: string; items: SearchShortcut[] }) {
|
||||
const { theme } = useCommonHooks();
|
||||
return (
|
||||
<>
|
||||
@@ -30,8 +31,10 @@ function HelpSection({ name, items }: { name: string; items: object[] }) {
|
||||
}}
|
||||
>
|
||||
{items
|
||||
?.toSorted((a: any, b: any) => (a.command > b.command ? 1 : -1))
|
||||
.map((item: any) => (
|
||||
?.toSorted((a: SearchShortcut, b: SearchShortcut) =>
|
||||
a.command > b.command ? 1 : -1,
|
||||
)
|
||||
.map((item: SearchShortcut) => (
|
||||
<HintItem key={item.command} command={item.command} name={item.name} />
|
||||
))}
|
||||
</Group>
|
||||
|
||||
Reference in New Issue
Block a user