Files
web/packages/design-system/lib/components/LinkList/LinkListItem/index.tsx
Rasmus Langvad d0546926a9 Merged in fix/3697-prettier-configs (pull request #3396)
fix(SW-3691): Setup one prettier config for whole repo

* Setup prettierrc in root and remove other configs


Approved-by: Joakim Jäderberg
Approved-by: Linus Flood
2026-01-07 12:45:50 +00:00

58 lines
1.3 KiB
TypeScript

import { MaterialIcon } from "../../Icons/MaterialIcon"
import { Typography } from "../../Typography"
import styles from "./linkListItem.module.css"
import {
IllustrationIcon,
IllustrationIconProps,
} from "../LinkListItem/IllustrationIcon"
import { cx } from "class-variance-authority"
import { Link } from "react-aria-components"
export interface LinkListItemProps {
text: string
isExternal?: boolean
href: string
className?: string
illustration?: IllustrationIconProps
onClick?: () => void
}
export function LinkListItem({
text,
isExternal,
href,
illustration,
onClick,
}: LinkListItemProps) {
return (
<Link
href={href}
target="_blank"
onClick={onClick}
className={cx(styles.content, {
[styles.graphic]: illustration,
[styles.noGraphic]: !illustration,
})}
>
{illustration && (
<div className={styles.illustrationWrapper}>
<IllustrationIcon
illustration={illustration.illustration}
size={illustration.size}
className={styles.illustration}
/>
</div>
)}
<Typography variant="Body/Paragraph/mdBold">
<p>{text}</p>
</Typography>
<MaterialIcon
color="Icon/Interactive/Default"
icon={isExternal ? "open_in_new" : "arrow_forward"}
/>
</Link>
)
}