-
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.
Merge pull request #31 from biosymbolics/refine_entity_display
Asset-oriented display
- Loading branch information
Showing
36 changed files
with
964 additions
and
872 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,32 @@ | ||
'use server'; | ||
|
||
import Typography from '@mui/joy/Typography'; | ||
|
||
import { fetchAutocompletions } from '@/app/core/actions'; | ||
import { SearchBar } from '@/components/composite'; | ||
import { Section } from '@/components/layout/section'; | ||
|
||
const Page = ({ searchParams }: { searchParams: Record<string, string> }) => { | ||
const { asset } = searchParams; | ||
|
||
return ( | ||
<> | ||
<Section variant="separated"> | ||
<SearchBar | ||
exemplarPatents={null} | ||
fetchAutocompletions={fetchAutocompletions} | ||
minPatentYears={null} | ||
queryType={null} | ||
terms={null} | ||
/> | ||
</Section> | ||
<Section variant="main"> | ||
<Section> | ||
<Typography level="h1">{asset}</Typography> | ||
</Section> | ||
</Section> | ||
</> | ||
); | ||
}; | ||
|
||
export default Page; |
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,47 @@ | ||
'use server'; | ||
|
||
import Box from '@mui/joy/Box'; | ||
import Alert from '@mui/joy/Alert'; | ||
import Typography from '@mui/joy/Typography'; | ||
import WarningIcon from '@mui/icons-material/Warning'; | ||
import 'server-only'; | ||
|
||
import { getAssetColumns } from '@/components/composite/assets/config'; | ||
import { DataGrid } from '@/components/data/grid'; | ||
import { EntitySearchArgs } from '@/types/entities'; | ||
|
||
import { fetchAssets } from '../actions'; | ||
|
||
export const AssetList = async (args: EntitySearchArgs) => { | ||
const columns = getAssetColumns(); | ||
try { | ||
const assets = await fetchAssets(args); | ||
return ( | ||
<Box height="100vh"> | ||
<DataGrid | ||
checkboxSelection | ||
disableRowSelectionOnClick | ||
columns={columns} | ||
rows={assets.map((asset) => ({ | ||
...asset, | ||
id: asset.name, | ||
}))} | ||
variant="maximal" | ||
/> | ||
</Box> | ||
); | ||
} catch (e) { | ||
return ( | ||
<Alert | ||
startDecorator={<WarningIcon />} | ||
variant="soft" | ||
color="warning" | ||
> | ||
<Typography level="h4">Failed to fetch patents</Typography> | ||
<Typography> | ||
{e instanceof Error ? e.message : JSON.stringify(e)} | ||
</Typography> | ||
</Alert> | ||
); | ||
} | ||
}; |
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
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
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
Oops, something went wrong.