Files
next-gdrive-index/src/app/@footer.tsx
T
2024-03-31 00:38:18 +07:00

43 lines
1.1 KiB
TypeScript

"use client";
import ReactMarkdown from "react-markdown";
type Props = {
content: string;
};
export default function Footer({ content }: Props) {
return (
<footer className='w-full pb-3'>
<ReactMarkdown
className='flex w-full select-none flex-col items-center justify-center'
components={{
p: ({ node, children, ...props }) => (
<p
{...props}
className='muted text-balance text-sm'
>
{children}
</p>
),
a: ({ node, children, ...props }) => {
const isExternal = props.href?.startsWith("http");
return (
<a
{...props}
className='text-balance text-sm text-blue-600 opacity-80 transition-all duration-300 hover:opacity-100 dark:text-blue-400'
target={isExternal ? "_blank" : undefined}
rel={isExternal ? "noopener noreferrer" : undefined}
>
{children}
</a>
);
},
}}
>
{content}
</ReactMarkdown>
</footer>
);
}