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