Typing
This commit is contained in:
@@ -5,7 +5,7 @@ import { textClasses } from 'styles';
|
||||
import type { Bookmark, BookmarkGroup } from 'types';
|
||||
import LinkGroups from './LinkGroups';
|
||||
|
||||
function Links({ contentType }: any) {
|
||||
function Links({ contentType }: { contentType: [string] }) {
|
||||
const { data: linkData, isFetched: linksIsFetched } = useQueryAPI({
|
||||
endpoint: 'api/links',
|
||||
});
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
import { Stack, Text } from '@mantine/core';
|
||||
import { textClasses } from 'styles';
|
||||
import type { Bookmark } from 'types';
|
||||
import LinkItem from './LinkItem';
|
||||
|
||||
function LinkGroups({ links, category }: any) {
|
||||
function LinkGroups({ links, category }: { links: Bookmark[]; category: string }) {
|
||||
return (
|
||||
<Stack
|
||||
style={{
|
||||
@@ -17,8 +18,8 @@ function LinkGroups({ links, category }: any) {
|
||||
{category}
|
||||
</Text>
|
||||
{links
|
||||
?.sort((a: any, b: any) => (a.index > b.index ? 1 : -1))
|
||||
.map((link: any) => (
|
||||
?.toSorted((a: Bookmark, b: Bookmark) => (a.index > b.index ? 1 : -1))
|
||||
.map((link: Bookmark) => (
|
||||
<LinkItem key={link.name} link={link} />
|
||||
))}
|
||||
</Stack>
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import { Text } from '@mantine/core';
|
||||
import { textClasses } from 'styles';
|
||||
import type { Bookmark } from 'types';
|
||||
|
||||
function LinkItem({ link }: any) {
|
||||
function LinkItem({ link }: { link: Bookmark }) {
|
||||
return (
|
||||
<Text
|
||||
className={textClasses.linkItem}
|
||||
|
||||
Reference in New Issue
Block a user