refactor: simplify Carousel component and update news data structure for clarity
This commit is contained in:
@@ -10,8 +10,8 @@ import { Button } from './button'
|
||||
|
||||
export const Carousel = (properties: TNews) => {
|
||||
const [currentIndex, setCurrentIndex] = useState(0)
|
||||
const location = useLocation()
|
||||
const hasCategory = location.pathname.includes('/category/')
|
||||
const { pathname } = useLocation()
|
||||
const hasCategory = pathname.includes('/category/')
|
||||
|
||||
const { title, description, items, type } = properties
|
||||
const itemsPerPage = type === 'hero' ? 1 : 3
|
||||
|
||||
Reference in New Issue
Block a user