Skip to content

armgit / kaneo

Public Imported from GitHub
0

⚡ Project management that doesn't become the project. Boards, Gantt charts, and GitHub integration. Self-host it or use Kaneo Cloud.

974 B
Raw Blame
import { useTranslation } from "react-i18next";
import { IntegrationPanelRow } from "@/components/project/integrations/panel/integration-panel-row";
import { Button } from "@/components/ui/button";

type StoredTokenRowProps = {
  maskedToken: string | null | undefined;
  editing: boolean;
  onEdit: () => void;
};

export function StoredTokenRow({
  maskedToken,
  editing,
  onEdit,
}: StoredTokenRowProps) {
  const { t } = useTranslation();

  return (
    <IntegrationPanelRow
      title={t("settings:codeHosting.tokenTitle")}
      description={
        maskedToken ? (
          <span>
            {t("settings:codeHosting.tokenStored")}{" "}
            <span className="font-mono">{maskedToken}</span>
          </span>
        ) : null
      }
    >
      {editing ? null : (
        <Button type="button" variant="outline" size="sm" onClick={onEdit}>
          {t("settings:codeHosting.changeToken")}
        </Button>
      )}
    </IntegrationPanelRow>
  );
}