import { ContentStatus, ContentStatusPhase } from "./db"; export default function ClearButton({ updateStatus, clear, disabled = false, }: { updateStatus: ContentStatus | null; clear: () => void; disabled?: boolean; }) { let button; if (updateStatus?.phase === ContentStatusPhase.IDLE && updateStatus?.local) { button = ( ); } else if (updateStatus?.phase === ContentStatusPhase.CLEAR) { button = ; } else { button = ( ); } return <>{button}; }