import ClearIcon from "@mui/icons-material/Clear"; import { Autocomplete, IconButton, TextField, Typography } from "@mui/material"; import React from "react"; import { useNavigate } from "react-router-dom"; import { Member } from "../../api/MemberApi"; import { useFamily } from "../BaseFamilyRoute"; import { MemberItem } from "../MemberItem"; export function MemberInput(p: { editable: boolean; current?: number; onValueChange: (n?: number) => void; label: string; filter: (m: Member) => boolean; }): React.ReactElement { const n = useNavigate(); const family = useFamily(); const choices = family.members.filter(p.filter); const [inputValue, setInputValue] = React.useState(""); if (p.current) { const member = family.members.get(p.current)!; return (