-
Notifications
You must be signed in to change notification settings - Fork 4
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
eb9e951
commit ad8e8c3
Showing
6 changed files
with
135 additions
and
91 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,51 @@ | ||
import React, { useState } from 'react'; | ||
|
||
import { Space, Button, theme, Tooltip } from 'antd'; | ||
|
||
import type { IDataset } from '../typing'; | ||
|
||
import { downloadDataset, runExtract, deleteDataset, useKuzuGraph } from '../service'; | ||
|
||
import { FileZipOutlined, DeleteOutlined, GlobalOutlined } from '@ant-design/icons'; | ||
|
||
const Action: React.FunctionComponent<IDataset> = props => { | ||
const { id, refreshList } = props; | ||
const [loading, setLoading] = useState(false); | ||
const handleDelete = async () => { | ||
await deleteDataset(id); | ||
refreshList && refreshList(); | ||
}; | ||
|
||
return ( | ||
<Space> | ||
<Tooltip title="Import into GraphScope for graph analysis"> | ||
<Button | ||
icon={<GlobalOutlined />} | ||
loading={loading} | ||
onClick={async () => { | ||
// const rest = await runInteractive(id); | ||
setLoading(true); | ||
const rest = await useKuzuGraph(id); | ||
setLoading(false); | ||
window.open(`#/paper-reading?graph_id=${id}`, '_blank'); | ||
}} | ||
> | ||
Graph Analysis | ||
</Button> | ||
</Tooltip> | ||
<Tooltip title="Download extracted graph dataset"> | ||
<Button | ||
icon={<FileZipOutlined />} | ||
onClick={() => { | ||
downloadDataset(id); | ||
}} | ||
></Button> | ||
</Tooltip> | ||
<Tooltip title="Delete dataset"> | ||
<Button onClick={handleDelete} icon={<DeleteOutlined />}></Button> | ||
</Tooltip> | ||
</Space> | ||
); | ||
}; | ||
|
||
export default Action; |
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