import React from 'react'
import "./Common_Heading_Holder.css"
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
import { faAngleRight } from '@fortawesome/free-solid-svg-icons'
import { useRouter } from 'next/navigation'

function Common_Heading_Holder({data, headingText, viewShowAllButton, subtext,goto }) {

  const navigate = useRouter()

  return (
    <>
      <section className='Common_Heading_Holder'>
        <h4 className='h4ppos'>{headingText}
          <br></br>
          <p className='subtext'>{subtext}</p>
        </h4>

        {viewShowAllButton && (
          <div className='show_all_text' onClick={() => {(navigate.push(goto))}}> 
            <p>View All  <FontAwesomeIcon icon={faAngleRight} className='righticon' /></p>
          </div>
        )}
      </section>
    </>
  )
}

export default Common_Heading_Holder
