hensei-web/components/about/LinkItem/index.tsx
Justin Edmund 2d02f88622 Fix Link component legacy behavior and tab switching
- Remove legacyBehavior prop and nested <a> tags from Link components
- Modernize to Next.js 13+ Link API with className directly on Link
- Convert external links to plain <a> tags (LinkItem, Discord link)
- Remove unnecessary passHref props from Header components
- Fix tab switching by mapping string values to GridType enum

The tab switching issue was caused by trying to parse string values
("characters", "weapons", "summons") as integers when they needed to
be mapped to GridType enum values.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-03 15:58:12 -07:00

34 lines
797 B
TypeScript

import { ComponentProps } from 'react'
import classNames from 'classnames'
import ShareIcon from '~public/icons/Share.svg'
import styles from './index.module.scss'
interface Props extends ComponentProps<'div'> {
title: string
link: string
icon: React.ReactNode
}
const LinkItem = ({ icon, title, link, className, ...props }: Props) => {
const classes = classNames(
{
[styles.item]: true,
},
className?.split(' ').map((c) => styles[c])
)
return (
<div className={classes}>
<a href={link} target="_blank" rel="noreferrer">
<div className={styles.left}>
<i className={styles.icon}>{icon}</i>
<h3>{title}</h3>
</div>
<ShareIcon className={styles.shareIcon} />
</a>
</div>
)
}
export default LinkItem