// Copyright (C) 2017-2024 Smart code 203358507 import React from 'react'; import Button from 'stremio/common/Button'; import { useTranslation } from 'react-i18next'; import classNames from 'classnames'; import Option from './Option'; import Icon from '@stremio/stremio-icons/react'; import styles from './Dropdown.less'; type Props = { options: MultiselectMenuOption[]; selectedOption?: MultiselectMenuOption | null; menuOpen: boolean | (() => void); level: number; setLevel: (level: number) => void; onSelect: (event: any) => void; }; const Dropdown = ({ level, setLevel, options, onSelect, selectedOption, menuOpen }: Props) => { const { t } = useTranslation(); const onBackButtonClick = () => { setLevel(level - 1); }; return (
{ level > 0 ? : null } { options .filter((option: MultiselectMenuOption) => !option.hidden) .map((option: MultiselectMenuOption, index) => (
); }; export default Dropdown;