From 93609fa3a1337430e3a5e4db343b6e83dfe26e3b Mon Sep 17 00:00:00 2001 From: aidanCQ Date: Mon, 7 Oct 2024 17:21:40 +0100 Subject: [PATCH] fix(): Optional next link config via props. --- src/custom/docs/components/triplecard/index.tsx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/custom/docs/components/triplecard/index.tsx b/src/custom/docs/components/triplecard/index.tsx index 7ca4a5d..e9771b5 100644 --- a/src/custom/docs/components/triplecard/index.tsx +++ b/src/custom/docs/components/triplecard/index.tsx @@ -1,5 +1,6 @@ import { Card, CardTitle, CardSubtitle } from './Card' import NextImage from 'next/image' +import NextLink from 'next/link' import { z } from 'zod' import { ComponentProps } from 'react' @@ -22,8 +23,8 @@ const cardSchema = z.array( const regularLink = (props: ComponentProps<'a'>) => -export const TripleCard = (props: {cards: z.infer, imageComponent: typeof NextImage | typeof regularLink }) => { - +export const TripleCard = (props: {cards: z.infer, imageComponent: typeof NextImage | typeof regularLink, useNextLink?: boolean }) => { + const LinkComponent = props.useNextLink ? NextLink : (props: ComponentProps<'a'>) => return (
{props.cards.map((item, idx, arr) => { @@ -65,12 +66,12 @@ export const TripleCard = (props: {cards: z.infer, imageCompo return (
  • - {link.title} - +
    {link.description}