diff --git a/src/webapp/app/(dashboard)/profile/[handle]/(withHeader)/opengraph-image.tsx b/src/webapp/app/(dashboard)/profile/[handle]/(withHeader)/opengraph-image.tsx index c2550b26..b1969e7d 100644 --- a/src/webapp/app/(dashboard)/profile/[handle]/(withHeader)/opengraph-image.tsx +++ b/src/webapp/app/(dashboard)/profile/[handle]/(withHeader)/opengraph-image.tsx @@ -1,6 +1,6 @@ import OpenGraphCard from '@/features/openGraph/components/openGraphCard/OpenGraphCard'; import { getProfile } from '@/features/profile/lib/dal.server'; -import { truncateText } from '@/lib/utils/text'; +import { abbreviateNumber, truncateText } from '@/lib/utils/text'; interface Props { params: Promise<{ handle: string }>; @@ -74,7 +74,7 @@ export default async function Image(props: Props) { margin: 0, }} > - {profile.urlCardCount}{' '} + {abbreviateNumber(profile.urlCardCount)}{' '} {profile.urlCardCount === 1 ? 'card' : 'cards'}

)} @@ -87,7 +87,7 @@ export default async function Image(props: Props) { margin: 0, }} > - {profile.collectionCount}{' '} + {abbreviateNumber(profile.collectionCount)}{' '} {profile.collectionCount === 1 ? 'collection' : 'collections'}

)} @@ -100,7 +100,7 @@ export default async function Image(props: Props) { margin: 0, }} > - {profile.connectionCount}{' '} + {abbreviateNumber(profile.connectionCount)}{' '} {profile.connectionCount === 1 ? 'connection' : 'connections'}

)} diff --git a/src/webapp/app/(dashboard)/profile/[handle]/(withoutHeader)/collections/[rkey]/opengraph-image.tsx b/src/webapp/app/(dashboard)/profile/[handle]/(withoutHeader)/collections/[rkey]/opengraph-image.tsx index 41a37c89..3b990d2a 100644 --- a/src/webapp/app/(dashboard)/profile/[handle]/(withoutHeader)/collections/[rkey]/opengraph-image.tsx +++ b/src/webapp/app/(dashboard)/profile/[handle]/(withoutHeader)/collections/[rkey]/opengraph-image.tsx @@ -1,6 +1,6 @@ import { getCollectionPageByAtUri } from '@/features/collections/lib/dal'; import OpenGraphCard from '@/features/openGraph/components/openGraphCard/OpenGraphCard'; -import { truncateText } from '@/lib/utils/text'; +import { abbreviateNumber, truncateText } from '@/lib/utils/text'; import { CollectionAccessType } from '@semble/types'; interface Props { @@ -121,7 +121,7 @@ export default async function Image(props: Props) { wordBreak: 'break-word', }} > - {collection.cardCount}{' '} + {abbreviateNumber(collection.cardCount)}{' '} {collection.cardCount > 1 ? 'cards' : 'card'}

)} @@ -140,7 +140,7 @@ export default async function Image(props: Props) { wordBreak: 'break-word', }} > - {collection.followerCount}{' '} + {abbreviateNumber(collection.followerCount)}{' '} {collection.followerCount > 1 ? 'followers' : 'follower'}

) : null} diff --git a/src/webapp/app/api/opengraph/semble/route.tsx b/src/webapp/app/api/opengraph/semble/route.tsx index 69961501..15ec6346 100644 --- a/src/webapp/app/api/opengraph/semble/route.tsx +++ b/src/webapp/app/api/opengraph/semble/route.tsx @@ -1,7 +1,7 @@ import { NextRequest } from 'next/server'; import OpenGraphCard from '@/features/openGraph/components/openGraphCard/OpenGraphCard'; import { getUrlMetadata } from '@/features/cards/lib/dal'; -import { truncateText } from '@/lib/utils/text'; +import { abbreviateNumber, truncateText } from '@/lib/utils/text'; import { getDomain, getUrlFromSlug } from '@/lib/utils/link'; export const runtime = 'edge'; @@ -145,7 +145,7 @@ export async function GET(request: NextRequest) { margin: 0, }} > - {metadata.libraries}{' '} + {abbreviateNumber(metadata.libraries ?? 0)}{' '} {metadata.libraries === 1 ? 'save' : 'saves'}

@@ -177,7 +177,7 @@ export async function GET(request: NextRequest) { margin: 0, }} > - {metadata.collections}{' '} + {abbreviateNumber(metadata.collections ?? 0)}{' '} {metadata.collections === 1 ? 'collection' : 'collections'} @@ -212,7 +212,7 @@ export async function GET(request: NextRequest) { margin: 0, }} > - {metadata.connections}{' '} + {abbreviateNumber(metadata.connections ?? 0)}{' '} {metadata.connections === 1 ? 'connection' : 'connections'} @@ -247,7 +247,7 @@ export async function GET(request: NextRequest) { margin: 0, }} > - {metadata.notes ?? 0}{' '} + {abbreviateNumber(metadata.notes ?? 0)}{' '} {metadata.notes === 1 ? 'note' : 'notes'}

diff --git a/src/webapp/next-env.d.ts b/src/webapp/next-env.d.ts index 9edff1c7..c4b7818f 100644 --- a/src/webapp/next-env.d.ts +++ b/src/webapp/next-env.d.ts @@ -1,6 +1,6 @@ /// /// -import "./.next/types/routes.d.ts"; +import "./.next/dev/types/routes.d.ts"; // NOTE: This file should not be edited // see https://nextjs.org/docs/app/api-reference/config/typescript for more information.