Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
}> = ({ userManager, user }) => {
const nexus = useNexusContext();
// fetch list of available realms when application mounts
const [realms, setRealms] = React.useState([]);
React.useEffect(() => {
nexus.Realm.list()
.then(realms => {
// nexus uses a realm called `serviceaccount` internally, we need to filter it out
setRealms(
realms._results.filter(
realm => realm._label !== SETTINGS.serviceAccountName,
),
);
})
.catch(e => console.error(e));
}, [nexus]);
export default (
{
org,
proj,
id,
}: {
org: string;
proj: string;
id: string;
},
viewEl: React.RefObject,
) => {
const nexus = useNexusContext();
const [morphology, setMorphology] = React.useState(null);
const [loading, setLoading] = React.useState(true);
const [error, setError] = React.useState(null);
const [stage, setStage] = React.useState();
// Download and Parse morphology
React.useEffect(() => {
setLoading(true);
setStage('Loading');
nexus.File.get(org, proj, encodeURIComponent(id), { as: 'blob' })
.then((morpho: any) => {
setStage('Converting');
return morpho;
})
.then(convertToSwc)
}> = props => {
const [downloadUrl, setDownloadUrl] = React.useState(null);
const [isLoading, setLoading] = React.useState(0);
const [isError, setError] = React.useState(false);
const nexus = useNexusContext();
const icons = ['download', 'loading', 'check'];
const refContainer = React.useRef(null);
const linkStyle: any = {
display: 'none',
};
const filePanel = () => {
if (props.isDownload && props.fileIds.length > 0) {
const fileName = props.downloadFileName
? `${props.downloadFileName}.tar.gz`
: 'nexus-download.tar.gz';
return (
<div>
</div>