import React from 'react' import { Text } from 'ink' import { Surface } from '../../../../ui/Surface.js' import { TextInput } from '../../../../ui/TextInput.js' import { theme } from '../../../../ui/theme.js' import { extractPinataJwt } from '../../../storage/ipfs.js' const PINATA_API_KEYS_URL = 'app.pinata.cloud/developers/api-keys' type PinataJwtInputProps = { inputKey: string title?: string subtitle?: React.ReactNode footer: React.ReactNode onSubmit: (input: string) => void onCancel: () => void } export const PinataJwtInput: React.FC = ({ inputKey, title, subtitle, footer, onSubmit, onCancel, }) => ( Paste your Pinata JWT. Get one at {PINATA_API_KEYS_URL} Saved encrypted on this device. Used only for IPFS pinning. { try { extractPinataJwt(v) return null } catch (err: unknown) { return (err as Error).message } }} onSubmit={onSubmit} onCancel={onCancel} /> )