fiemwl / bin /cli /tui-components /KeyMaskedDisplay.jsx
automindy's picture
Upload 2581 files
5448d8b verified
Raw
History Blame Contribute Delete
354 Bytes
import React from "react";
import { Text } from "ink";
export function KeyMaskedDisplay({ apiKey, revealed = false }) {
if (!apiKey) return <Text dimColor>(none)</Text>;
const display = revealed
? apiKey
: apiKey.length <= 8
? "***"
: `${apiKey.slice(0, 6)}***${apiKey.slice(-4)}`;
return <Text>{display}</Text>;
}