This commit is contained in:
Sean Edmunds
2025-04-15 20:21:25 -05:00
parent 2e72b76e95
commit 78dec160b6
34 changed files with 225 additions and 466 deletions

View File

@@ -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',
});

View File

@@ -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>

View File

@@ -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}