feat(SW-322): fix typo
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
import { ArrowRightIcon } from "@/components/Icons"
|
||||
import Link from "@/components/TempDesignSystem/Link"
|
||||
import Body from "@/components/TempDesignSystem/Text/Body"
|
||||
|
||||
import styles from "./twoColumnList.module.css"
|
||||
|
||||
import { ShortcutsListProps } from "@/types/components/myPages/myPage/shortcuts"
|
||||
|
||||
export default function TwoColumnList({ linkList }: ShortcutsListProps) {
|
||||
const middleIndex = Math.ceil(linkList.length / 2)
|
||||
const leftColumn = linkList.slice(0, middleIndex)
|
||||
const rightColumn = linkList.slice(middleIndex)
|
||||
|
||||
function renderShortcuts({ linkList }: ShortcutsListProps) {
|
||||
return linkList.map((shortcut) => (
|
||||
<Link
|
||||
href={shortcut.url}
|
||||
key={shortcut.title}
|
||||
target={shortcut.openInNewTab ? "_blank" : undefined}
|
||||
variant="shortcut"
|
||||
className={styles.link}
|
||||
>
|
||||
<Body textTransform="bold" color="burgundy">
|
||||
<span>{shortcut.text ? shortcut.text : shortcut.title}</span>
|
||||
</Body>
|
||||
<ArrowRightIcon color="burgundy" width={24} height={24} />
|
||||
</Link>
|
||||
))
|
||||
}
|
||||
|
||||
return (
|
||||
<section className={styles.section}>
|
||||
<div className={styles.columeOne}>
|
||||
{renderShortcuts({ linkList: leftColumn })}
|
||||
</div>
|
||||
<div className={styles.columnTwo}>
|
||||
{renderShortcuts({ linkList: rightColumn })}
|
||||
</div>
|
||||
</section>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user