-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ba128f0
commit 42b6bdf
Showing
5 changed files
with
134 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
'use client'; | ||
|
||
import { useAtomValue } from 'jotai'; | ||
|
||
import { selectedEModelAtom, selectedMModelAtom } from '@/state/virtual-lab/build/me-model'; | ||
import MorphologyCard from '@/components/build-section/virtual-lab/me-model/MorphologyCard'; | ||
import EModelCard from '@/components/build-section/virtual-lab/me-model/EModelCard'; | ||
|
||
export default function SummaryPage() { | ||
const selectedEModel = useAtomValue(selectedEModelAtom); | ||
const selectedMModel = useAtomValue(selectedMModelAtom); | ||
|
||
if (!selectedEModel || !selectedMModel) { | ||
return ( | ||
<h2 className="flex h-full items-center justify-center"> | ||
Select Morpholgy and EModel first. | ||
</h2> | ||
); | ||
} | ||
|
||
return ( | ||
<div className="flex h-full flex-col gap-10 p-10"> | ||
<div className="text-2xl font-bold text-primary-8">Single Neuron</div> | ||
<MorphologyCard /> | ||
<EModelCard /> | ||
</div> | ||
); | ||
} |
72 changes: 72 additions & 0 deletions
72
src/components/build-section/virtual-lab/me-model/EModelCard.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
import { useAtomValue } from 'jotai'; | ||
import { Empty } from 'antd'; | ||
|
||
import { selectedEModelAtom } from '@/state/virtual-lab/build/me-model'; | ||
import { classNames } from '@/util/utils'; | ||
import EModelTracePreview from '@/components/explore-section/ExploreSectionListingView/EModelTracePreview'; | ||
import { ESeModel } from '@/types/explore-section/es'; | ||
|
||
const subtitleStyle = 'uppercase font-thin text-slate-600'; | ||
|
||
export default function EModelCard() { | ||
const selectedEModel = useAtomValue(selectedEModelAtom); | ||
|
||
if (!selectedEModel) return null; | ||
|
||
return ( | ||
<div className="w-full border p-10"> | ||
<div className="flex justify-between"> | ||
<div className={classNames('text-2xl', subtitleStyle)}>E-Model</div> | ||
<a href={selectedEModel['@id']} target="_blank" className="font-bold text-primary-8"> | ||
More details | ||
</a> | ||
</div> | ||
|
||
<div className="mt-2 flex gap-10"> | ||
<EModelThumbnail emodel={selectedEModel} /> | ||
<div className="flex-grow"> | ||
<div className={subtitleStyle}>NAME</div> | ||
<div className="my-1 text-3xl font-bold text-primary-8">{selectedEModel.name}</div> | ||
<Details emodel={selectedEModel} /> | ||
</div> | ||
</div> | ||
</div> | ||
); | ||
} | ||
|
||
function Details({ emodel }: { emodel: ESeModel }) { | ||
return ( | ||
<div className="mt-4 grid grid-cols-3 gap-4 text-primary-8"> | ||
<div> | ||
<div className={subtitleStyle}>Examplar morphology</div> | ||
<div>Unknown</div> | ||
</div> | ||
|
||
<div> | ||
<div className={subtitleStyle}>Optimization target</div> | ||
<div>Unknown</div> | ||
</div> | ||
|
||
<div> | ||
<div className={subtitleStyle}>Brain Region</div> | ||
<div>{emodel.brainRegion?.label || 'Unknown'}</div> | ||
</div> | ||
|
||
<div> | ||
<div className={subtitleStyle}>E-Type</div> | ||
<div>{emodel.eType?.label || 'Unknown'}</div> | ||
</div> | ||
</div> | ||
); | ||
} | ||
|
||
function EModelThumbnail({ emodel }: { emodel: ESeModel }) { | ||
if (!emodel.image) | ||
return <Empty description="No thumbnail available" image={Empty.PRESENTED_IMAGE_SIMPLE} />; | ||
|
||
return ( | ||
<div className="border border-black"> | ||
<EModelTracePreview images={emodel.image} height={200} width={200} /> | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters