Skip to content

armgit / memos

Public Imported from GitHub
0

Memos is an open-source, self-hosted note-taking app that brings your everyday thoughts together in a personal timeline. Your data stays yours, and you choose what to keep private or share.

849 B
Raw Blame
import { Button } from "@/components/ui/button";
import { useTranslate } from "@/utils/i18n";

export type MemoParentStatus = "loading" | "unavailable" | "error";

export default function MemoParentPlaceholder({ status, onRetry }: { status: MemoParentStatus; onRetry?: () => void }) {
  const t = useTranslate();
  return (
    <div className="px-2 py-1.5 text-xs text-muted-foreground" role="status">
      <p>{t(status === "loading" ? "memo.parent-loading" : status === "error" ? "memo.parent-load-error" : "memo.parent-unavailable")}</p>
      {status === "unavailable" && <p className="mt-1 leading-5">{t("memo.parent-unavailable-description")}</p>}
      {status === "error" && onRetry && (
        <Button variant="ghost" size="sm" className="mt-1" onClick={onRetry}>
          {t("search.retry")}
        </Button>
      )}
    </div>
  );
}