import Image from "next/image"
import Link from '@/core/components/elements/Link/Link'
import { createSlug } from '@/core/utils/slug'

const CategorySection = ({ categories }) => {
    return (
        <section>
            <div className="group/item grid grid-cols-5 gap-y-2 w-full h-full col-span-2 ">
                {categories.map((category) => (
                    <div className="KartuInti h-24 w-26 max-w-sm   lg:max-w-full flex flex-col   border-[1px] border-gray-200  relative group">
                        <div className='KartuB absolute h-48 w-60 inset-0 flex items-center justify-center '>
                            <div className="group/edit flex items-center justify-center h-48 w-60  flex-row group-hover/item:visible">
                                <div className=' h-36'>
                                    <Image className="group-hover:scale-110 duration-300"  src='https://erp.indoteknik.com/api/image/product.template/image_256/544371?ratio=square' width={36} height={26} alt={category?.name} />
                                </div>
                                <h2 className="text-gray-700 content-center text-wrap h-12 border-t-[1px] w-60 px-1 border-gray-200 font-normal text-sm text-center">{category?.name}</h2>
                            </div>
                        </div>
                    </div>
                ))}
        </div>
        </section>
    )
}

export default CategorySection