diff --git a/src/frontend/src/components/cardComponent/index.tsx b/src/frontend/src/components/cardComponent/index.tsx index c3df25ba0..f44e1e48f 100644 --- a/src/frontend/src/components/cardComponent/index.tsx +++ b/src/frontend/src/components/cardComponent/index.tsx @@ -3,6 +3,7 @@ import { alertContext } from "../../contexts/alertContext"; import { FlowsContext } from "../../contexts/flowsContext"; import { StoreContext } from "../../contexts/storeContext"; import { getComponent, postLikeComponent } from "../../controllers/API"; +import DeleteConfirmationModal from "../../modals/DeleteConfirmationModal"; import { storeComponent } from "../../types/store"; import cloneFLowWithParent from "../../utils/storeUtils"; import { cn } from "../../utils/utils"; @@ -166,13 +167,17 @@ export default function CollectionCardComponent({ )} - {onDelete && ( - + )} @@ -207,36 +212,69 @@ export default function CollectionCardComponent({ {data.liked_by_count != undefined && (
- - - + { + onDelete(); + }} + > + + + + ) : ( + + + + )} +
+
+
+

{title}

+

{description}

+
+ + {children} +
+
+ ); +} diff --git a/src/frontend/src/modals/DeleteConfirmationModal/index.tsx b/src/frontend/src/modals/DeleteConfirmationModal/index.tsx new file mode 100644 index 000000000..4c1e48699 --- /dev/null +++ b/src/frontend/src/modals/DeleteConfirmationModal/index.tsx @@ -0,0 +1,56 @@ +import { DialogClose } from "@radix-ui/react-dialog"; +import { Trash2 } from "lucide-react"; +import { Button } from "../../components/ui/button"; +import { + Dialog, + DialogContent, + DialogDescription, + DialogFooter, + DialogHeader, + DialogTitle, + DialogTrigger, +} from "../../components/ui/dialog"; + +export default function DeleteConfirmationModal({ + children, + onConfirm, + description, +}: { + children: JSX.Element; + onConfirm: () => void; + description?: string; +}) { + return ( + + {children} + + + +
+ Delete +
+
+ + Are you sure you want to delete this {description ?? "component"}? +

+ This action cannot be undone. +
+
+ + + + + + + +
+
+ ); +} diff --git a/src/frontend/src/pages/StorePage/index.tsx b/src/frontend/src/pages/StorePage/index.tsx index 40f4877ad..2e03b93f8 100644 --- a/src/frontend/src/pages/StorePage/index.tsx +++ b/src/frontend/src/pages/StorePage/index.tsx @@ -4,10 +4,9 @@ import PaginatorComponent from "../../components/PaginatorComponent"; import ShadTooltip from "../../components/ShadTooltipComponent"; import CollectionCardComponent from "../../components/cardComponent"; import IconComponent from "../../components/genericIconComponent"; -import Header from "../../components/headerComponent"; +import PageLayout from "../../components/pageLayout"; import { SkeletonCardComponent } from "../../components/skeletonCardComponent"; import { Badge } from "../../components/ui/badge"; -import { Button } from "../../components/ui/button"; import { Input } from "../../components/ui/input"; import { Select, @@ -21,7 +20,6 @@ import { alertContext } from "../../contexts/alertContext"; import { AuthContext } from "../../contexts/authContext"; import { StoreContext } from "../../contexts/storeContext"; import { getStoreComponents, getStoreTags } from "../../controllers/API"; -import StoreApiKeyModal from "../../modals/StoreApiKeyModal"; import { storeComponent } from "../../types/store"; import { cn } from "../../utils/utils"; export default function StorePage(): JSX.Element { @@ -197,237 +195,222 @@ export default function StorePage(): JSX.Element { }; return ( - <> -
- -
-
-
- - - Langflow Store - -
- {StoreApiKeyModal && ( - - - - )} -
-
- - Search flows and components from the community. - -
-
-
- { - setInputText(e.target.value); - }} - onKeyDown={(e) => { - if (e.key === "Enter") { - setSearchNow(uniqueId()); - } - }} - value={inputText} - /> - + + )}} */ + > +
+
+
+
+ { + setInputText(e.target.value); + }} + onKeyDown={(e) => { + if (e.key === "Enter") { setSearchNow(uniqueId()); - }} - > - - -
-
- - - - - - -
-
- -
- -
-
- {!loadingTags && - tags.map((tag, idx) => ( - - ))} -
-
-
-
- - {(!loading || searchData.length !== 0) && ( - <> - {totalRowsCount}{" "} - {totalRowsCount !== 1 ? "results" : "result"} - - )} - - - + +
+
+ + + + + + +
+
-
- {!loading || searchData.length !== 0 ? ( - searchData.map((item) => { - return ( - <> - - - ); - }) - ) : ( +
+ +
+
+ {!loadingTags && + tags.map((tag, idx) => ( + + ))} +
+
+
+
+ + {(!loading || searchData.length !== 0) && ( <> - - - + {totalRowsCount} {totalRowsCount !== 1 ? "results" : "result"} )} -
+ - {!loading && searchData?.length === 0 && ( -
-
-
-
- You haven't{" "} - {selectFilter === "createdbyme" ? "created" : "liked"}{" "} - anything yet. -
+ +
+ +
+ {!loading || searchData.length !== 0 ? ( + searchData.map((item) => { + return ( + <> + + + ); + }) + ) : ( + <> + + + + + )} +
+ + {!loading && searchData?.length === 0 && ( +
+
+
+
+ You haven't{" "} + {selectFilter === "createdbyme" ? "created" : "liked"}{" "} + anything yet.
- )} -
+
+ )}
{!loading && searchData.length > 0 && ( -
+
)}
- + ); }