diff --git a/src/components/CatalogSortDropdown.tsx b/src/components/CatalogSortDropdown.tsx index 1a66eb3..3abcb9a 100644 --- a/src/components/CatalogSortDropdown.tsx +++ b/src/components/CatalogSortDropdown.tsx @@ -3,16 +3,17 @@ import React, { useState, useRef, useEffect } from 'react'; interface CatalogSortDropdownProps { active: number; onChange: (index: number) => void; + options?: string[]; } -const sortOptions = [ +const defaultSortOptions = [ 'По популярности', 'Сначала дешевле', 'Сначала дороже', 'Высокий рейтинг', ]; -const CatalogSortDropdown: React.FC = ({ active, onChange }) => { +const CatalogSortDropdown: React.FC = ({ active, onChange, options = defaultSortOptions }) => { const [isOpen, setIsOpen] = useState(false); const dropdownRef = useRef(null); @@ -52,7 +53,7 @@ const CatalogSortDropdown: React.FC = ({ active, onCha
Сортировка