Download bin/cli/tui-components/KeyMaskedDisplay.jsx from automindy/fiemwl: direct link, hf CLI and curl.
- Browser
- Download file 354 Bytes
-
https://huggingface.co/spaces/automindy/fiemwl/resolve/main/bin/cli/tui-components/KeyMaskedDisplay.jsx
- Command line
-
hf download hf://spaces/automindy/fiemwl/bin/cli/tui-components/KeyMaskedDisplay.jsx
-
curl -L -o KeyMaskedDisplay.jsx https://huggingface.co/spaces/automindy/fiemwl/resolve/main/bin/cli/tui-components/KeyMaskedDisplay.jsx
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>; | |
| } | |