import { CenteredFlex } from "@/base/components/containers"; import { ActivityIndicator } from "@/base/components/mui/ActivityIndicator"; import CopyButton from "@ente/shared/components/CopyButton"; import { Box, Typography } from "@mui/material"; import React from "react"; interface CodeBlockProps { /** * The code (an arbitrary string) to show. * * If not present, then an activity indicator will be shown. */ code: string | undefined; } /** * A component that shows a "code" (e.g. the user's recovery key, or a 2FA setup * code), alongwith a button to copy it. */ export const CodeBlock: React.FC = ({ code }) => { if (!code) { return ( ); } return ( {code} ); };