Add ExportModal component to ShareModal (#1789)
* Add ExportModal component to ShareModal * Refactor ShareModal component to conditionally render ExportModal and Export button based on is_component flag
This commit is contained in:
parent
8f46ea04ef
commit
736ce22546
1 changed files with 21 additions and 5 deletions
|
|
@ -25,6 +25,7 @@ import {
|
||||||
import { getTagsIds } from "../../utils/storeUtils";
|
import { getTagsIds } from "../../utils/storeUtils";
|
||||||
import ConfirmationModal from "../ConfirmationModal";
|
import ConfirmationModal from "../ConfirmationModal";
|
||||||
import BaseModal from "../baseModal";
|
import BaseModal from "../baseModal";
|
||||||
|
import ExportModal from "../exportModal";
|
||||||
|
|
||||||
export default function ShareModal({
|
export default function ShareModal({
|
||||||
component,
|
component,
|
||||||
|
|
@ -206,9 +207,8 @@ export default function ShareModal({
|
||||||
{children ? children : <></>}
|
{children ? children : <></>}
|
||||||
</BaseModal.Trigger>
|
</BaseModal.Trigger>
|
||||||
<BaseModal.Header
|
<BaseModal.Header
|
||||||
description={`Publish ${
|
description={`Publish ${is_component ? "your component" : "workflow"
|
||||||
is_component ? "your component" : "workflow"
|
} to the Langflow Store.`}
|
||||||
} to the Langflow Store.`}
|
|
||||||
>
|
>
|
||||||
<span className="pr-2">Share</span>
|
<span className="pr-2">Share</span>
|
||||||
<IconComponent
|
<IconComponent
|
||||||
|
|
@ -251,18 +251,34 @@ export default function ShareModal({
|
||||||
|
|
||||||
<BaseModal.Footer>
|
<BaseModal.Footer>
|
||||||
<div className="flex w-full justify-between gap-2">
|
<div className="flex w-full justify-between gap-2">
|
||||||
<Button
|
{!is_component && <ExportModal>
|
||||||
|
<Button
|
||||||
|
type="button"
|
||||||
|
variant="outline"
|
||||||
|
className="gap-2"
|
||||||
|
onClick={() => {
|
||||||
|
// (setOpen || internalSetOpen)(false);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<IconComponent name="Download" className="h-4 w-4" />
|
||||||
|
Export
|
||||||
|
</Button>
|
||||||
|
</ExportModal>
|
||||||
|
}
|
||||||
|
{is_component && <Button
|
||||||
type="button"
|
type="button"
|
||||||
variant="outline"
|
variant="outline"
|
||||||
className="gap-2"
|
className="gap-2"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
handleExportComponent();
|
|
||||||
(setOpen || internalSetOpen)(false);
|
(setOpen || internalSetOpen)(false);
|
||||||
|
handleExportComponent();
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<IconComponent name="Download" className="h-4 w-4" />
|
<IconComponent name="Download" className="h-4 w-4" />
|
||||||
Export
|
Export
|
||||||
</Button>
|
</Button>
|
||||||
|
|
||||||
|
}
|
||||||
<Button
|
<Button
|
||||||
disabled={loadingNames}
|
disabled={loadingNames}
|
||||||
type="button"
|
type="button"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue