import React, {useState} from 'react'; import {Button, Menu} from 'react-native-paper'; export default function DayMenu({ onSelect, onDelete, selected, index, names, }: { onSelect: (option: string) => void; onDelete: () => void; selected: string; index: number; names: string[]; }) { const [show, setShow] = useState(false); const select = (day: string) => { onSelect(day); setShow(false); }; return ( setShow(false)} anchor={ }> {names.map(name => ( select(name)} title={name} /> ))} {index > 0 && ( )} ); }