-
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.
feat(web): implement support for new operations
Implements new UI for deleting and transferring packages.
- Loading branch information
1 parent
b046ace
commit 1e017f3
Showing
13 changed files
with
930 additions
and
185 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
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,70 @@ | ||
/* === This file is part of bxt === | ||
* | ||
* SPDX-FileCopyrightText: 2024 Artem Grinev <[email protected]> | ||
* SPDX-License-Identifier: AGPL-3.0-or-later | ||
* | ||
*/ | ||
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; | ||
import { Button, Table } from "react-daisyui"; | ||
import { | ||
faCube, | ||
faSignature, | ||
faTrashCan | ||
} from "@fortawesome/free-solid-svg-icons"; | ||
|
||
type CommitTableProps = { | ||
action?: AddAction; | ||
deletePackage?: (name: string) => void; | ||
}; | ||
|
||
export const AddTable = ({ action, deletePackage }: CommitTableProps) => { | ||
return ( | ||
<Table zebra={true} size="xs" className="overflow-x-auto"> | ||
<Table.Head> | ||
<span>Name</span> | ||
<span /> | ||
<span /> | ||
</Table.Head> | ||
<Table.Body> | ||
{Array.from(action || []).map(([name, upload]) => ( | ||
<Table.Row key={name}> | ||
<span className="flex items-center"> | ||
{upload.file !== undefined && ( | ||
<FontAwesomeIcon | ||
icon={faCube} | ||
className="px-2 max-h-6" | ||
/> | ||
)} | ||
{upload.signatureFile !== undefined && ( | ||
<FontAwesomeIcon | ||
icon={faSignature} | ||
color="green" | ||
className="px-2 max-h-6" | ||
/> | ||
)} | ||
{name} | ||
</span> | ||
<span></span> | ||
<span> | ||
<Button | ||
size="xs" | ||
color="error" | ||
onClick={(e) => { | ||
e.preventDefault(); | ||
deletePackage?.(name); | ||
}} | ||
> | ||
<FontAwesomeIcon | ||
icon={faTrashCan} | ||
color="white" | ||
className="max-h-6" | ||
/> | ||
</Button> | ||
</span> | ||
</Table.Row> | ||
))} | ||
</Table.Body> | ||
</Table> | ||
); | ||
}; | ||
export default AddTable; |
Oops, something went wrong.