* Update button on DataSourceSelector * Removed dead code ToolbarButtonNestedMenu, button spacing
56 lines
1.7 KiB
TypeScript
56 lines
1.7 KiB
TypeScript
import React from 'react';
|
|
import classnames from 'classnames';
|
|
import { useNavigate } from 'react-router-dom';
|
|
import { useAppConfig } from '@state';
|
|
|
|
import { Button } from '@ohif/ui-next';
|
|
|
|
function DataSourceSelector() {
|
|
const [appConfig] = useAppConfig();
|
|
const navigate = useNavigate();
|
|
|
|
// This is frowned upon, but the raw config is needed here to provide
|
|
// the selector
|
|
const dsConfigs = appConfig.dataSources;
|
|
|
|
return (
|
|
<div style={{ width: '100%', height: '100%' }}>
|
|
<div className="flex h-screen w-screen items-center justify-center">
|
|
<div className="bg-popover mx-auto space-y-2 rounded-lg py-8 px-8 drop-shadow-md">
|
|
<img
|
|
className="mx-auto block h-14"
|
|
src="./ohif-logo.svg"
|
|
alt="OHIF"
|
|
/>
|
|
<div className="space-y-2 pt-4 text-center">
|
|
{dsConfigs
|
|
.filter(it => it.sourceName !== 'dicomjson' && it.sourceName !== 'dicomlocal')
|
|
.map(ds => (
|
|
<div key={ds.sourceName}>
|
|
<h1 className="text-foreground">
|
|
{ds.configuration?.friendlyName || ds.friendlyName}
|
|
</h1>
|
|
<Button
|
|
variant="secondary"
|
|
className={classnames('ml-2', 'mt-1')}
|
|
onClick={() => {
|
|
navigate({
|
|
pathname: '/',
|
|
search: `datasources=${ds.sourceName}`,
|
|
});
|
|
}}
|
|
>
|
|
{ds.sourceName}
|
|
</Button>
|
|
<br />
|
|
</div>
|
|
))}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
);
|
|
}
|
|
|
|
export default DataSourceSelector;
|