Skip to content

Commit

Permalink
coderabbitai: Improve readability
Browse files Browse the repository at this point in the history
  • Loading branch information
hiroasano committed Sep 6, 2024
1 parent 1438410 commit ce7cd11
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,15 @@ export function RerollConfirmationDialog({ open, setOpen, onClick }: Props) {
</Alert>

<DialogFooter className="justify-end">
<Button type="button" onClick={() => setOpen(!open)} variant="secondary">
<Button
aria-label="Cancel"
type="button"
onClick={() => setOpen(!open)}
variant="secondary"
>
Cancel
</Button>
<Button type="submit" variant="alert" onClick={onClick}>
<Button aria-label="Reroll Key Submit" type="submit" variant="alert" onClick={onClick}>
Reroll Key
</Button>
</DialogFooter>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,9 @@ export function RerollNewKeyDialog({ newKey, apiId, keyAuthId }: Props) {
return null;
}

const split = newKey.key.split("_") ?? [];
const split = newKey.key.split("_");
const maskedKey =
split.length >= 2
? `${split.at(0)}_${"*".repeat(split.at(1)?.length ?? 0)}`
: "*".repeat(split.at(0)?.length ?? 0);
split.length >= 2 ? `${split[0]}_${"*".repeat(split[1].length)}` : "*".repeat(split[0].length);
const [showKey, setShowKey] = useState(false);

const [open, setOpen] = useState(Boolean(newKey));
Expand All @@ -61,10 +59,14 @@ export function RerollNewKeyDialog({ newKey, apiId, keyAuthId }: Props) {
</Code>
<DialogFooter className="justify-end">
<Link href={`/keys/${keyAuthId}`}>
<Button variant="secondary">Back</Button>
<Button aria-label="Back" variant="secondary">
Back
</Button>
</Link>
<Link href={`/apis/${apiId}/keys/${keyAuthId}/${newKey.keyId}`}>
<Button variant="secondary">View key details</Button>
<Button aria-label="View key details" variant="secondary">
View key details
</Button>
</Link>
</DialogFooter>
</DialogContent>
Expand Down

0 comments on commit ce7cd11

Please sign in to comment.