import { IonItem, IonItemOption, IonItemOptions, IonItemSliding, IonLabel, IonRadio, IonReorder, IonText, } from "@ionic/react"; import { Credential, logoutAccount } from "./authSlice"; import { useAppDispatch } from "../../store"; import { RemoveItemButton } from "../shared/ListEditor"; interface AccountProps { editing: boolean; account: Credential; allowEdit: boolean; } export default function Account({ editing, account, allowEdit }: AccountProps) { const dispatch = useAppDispatch(); function logout() { dispatch(logoutAccount(account.handle)); } const isGuest = !account.jwt; const label = ( <> {account.handle} {isGuest && (guest)} ); return ( {allowEdit && ( {isGuest ? "Remove" : "Log out"} )} {editing && } {editing ? ( <> {label} ) : ( {label} )} ); }