Skip to content

A local-first multi-agent app development platform, built on PenguinHarness

1.1 KB
Raw Blame
/**
 * Account page of the Settings dialog: the credentials the signed-in account can change. Only
 * mounted where a password exists to change — the desktop shell's own window signs in
 * through a one-shot token and is filtered out by the section registry (see
 * offersChangePassword for the full rule).
 */
import { useState } from "react";
import { Button, PrefRow } from "@adelie/ui";
import { S } from "../../lib/strings";
import { ChangePasswordDialog } from "../../components/account/change-password-dialog";

export function AccountSection() {
  const [changePasswordOpen, setChangePasswordOpen] = useState(false);
  return (
    <div className="divide-y divide-gray-100 dark:divide-gray-800/60">
      <PrefRow label={S.account.changePassword} info={S.settings.changePasswordInfo}>
        <Button size="sm" variant="secondary" onClick={() => setChangePasswordOpen(true)}>
          {S.account.changePassword}
        </Button>
      </PrefRow>
      <ChangePasswordDialog
        open={changePasswordOpen}
        onClose={() => setChangePasswordOpen(false)}
      />
    </div>
  );
}