import Shortcut from "../Shortcut"

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)

  return (
    <section className={styles.section}>
      <div className={styles.leftColumn}>
        <Shortcut linkList={leftColumn} />
      </div>
      <div className={styles.rightColumn}>
        <Shortcut linkList={rightColumn} />
      </div>
    </section>
  )
}
