import * as React from 'react';
import { Alert, ClipboardCopy, Skeleton, Content } from '@patternfly/react-core';
import { useImageProxy } from '~/hooks/useImageProxy';
import ExternalLink from '~/shared/components/links/ExternalLink';
import { getErrorState } from '~/shared/utils/error-utils';
const ComponentRegistryLogin: React.FC = () => {
const [urlInfo, loaded, error] = useImageProxy();
// Show skeleton while loading
if (!loaded) {
return ;
}
// Handle error state
if (error) {
return getErrorState(error, loaded, 'registry login URL', true);
}
// Handle domain not configured
if (!urlInfo) {
return (
);
}
const oauthUrl = urlInfo.buildUrl(urlInfo.oauthPath);
return (
<>
Get your authentication token
{' and use it as the password when prompted'}
{`podman login -u unused ${urlInfo.hostname}`}
>
);
};
export default ComponentRegistryLogin;