diff --git a/frontend/src/components/workspace/catalog/action-tiles-schema.ts b/frontend/src/components/workspace/catalog/action-tiles-schema.ts deleted file mode 100644 index 323a4a6e..00000000 --- a/frontend/src/components/workspace/catalog/action-tiles-schema.ts +++ /dev/null @@ -1,140 +0,0 @@ -import { - Blend, - BookText, - CheckSquare, - Container, - FlaskConical, - GitCompareArrows, - Globe, - Languages, - LucideIcon, - Mail, - Regex, - Send, - ShieldAlert, - Sparkles, - Split, - Tags, - Webhook, -} from "lucide-react" - -import { ActionType } from "@/types/schemas" - -export type ActionTile = { - type?: ActionType - title?: string - icon: LucideIcon - variant: "default" | "ghost" - hierarchy?: "groupItem" | "group" - availability?: "comingSoon" -} - -export const actionTiles: ActionTile[] = [ - { - type: "webhook", - title: "Webhook", - icon: Webhook, - variant: "ghost", - }, - { - type: "http_request", - title: "HTTP Request", - icon: Globe, - variant: "ghost", - }, - { - type: "data_transform", - title: "Data Transform", - icon: Blend, - variant: "ghost", - availability: "comingSoon", - }, - { - title: "Condition", - icon: Split, - variant: "ghost", - hierarchy: "group", - }, - { - type: "condition.compare", - title: "Compare", - icon: GitCompareArrows, - variant: "ghost", - hierarchy: "groupItem", - }, - { - type: "condition.regex", - title: "Regex", - icon: Regex, - variant: "ghost", - hierarchy: "groupItem", - }, - { - type: "condition.membership", - title: "Membership", - icon: Container, - variant: "ghost", - hierarchy: "groupItem", - availability: "comingSoon", - }, - { - type: "open_case", - title: "Open Case", - icon: ShieldAlert, - variant: "ghost", - }, - { - type: "receive_email", - title: "Receive Email", - icon: Mail, - variant: "ghost", - availability: "comingSoon", - }, - { - type: "send_email", - title: "Send Email", - icon: Send, - variant: "ghost", - }, - { - title: "AI Actions", - icon: Sparkles, - variant: "ghost", - hierarchy: "group", - }, - { - type: "llm.extract", - title: "Extract", - icon: FlaskConical, - variant: "ghost", - hierarchy: "groupItem", - }, - { - type: "llm.label", - title: "Label", - icon: Tags, - variant: "ghost", - hierarchy: "groupItem", - }, - { - type: "llm.translate", - title: "Translate", - icon: Languages, - variant: "ghost", - hierarchy: "groupItem", - }, - { - type: "llm.choice", - title: "Choice", - icon: CheckSquare, - variant: "ghost", - hierarchy: "groupItem", - }, - { - type: "llm.summarize", - title: "Summarize", - icon: BookText, - variant: "ghost", - hierarchy: "groupItem", - }, -] diff --git a/frontend/src/components/workspace/catalog/udfs-catalog.tsx b/frontend/src/components/workspace/catalog/udfs-catalog.tsx deleted file mode 100644 index afb18647..00000000 --- a/frontend/src/components/workspace/catalog/udfs-catalog.tsx +++ /dev/null @@ -1,134 +0,0 @@ -import { DragEvent } from "react" -import { ScrollArea } from "@radix-ui/react-scroll-area" -import { Node } from "reactflow" - -import { UDF, useUDFs } from "@/lib/udf" -import { groupBy, undoSlugify } from "@/lib/utils" -import { - Accordion, - AccordionContent, - AccordionItem, - AccordionTrigger, -} from "@/components/ui/accordion" -import DecoratedHeader from "@/components/decorated-header" -import { getIcon } from "@/components/icons" -import { CenteredSpinner } from "@/components/loading/spinner" -import { AlertNotification } from "@/components/notifications" - -export type UDFNodeType = Node - -export const UDF_NODE_TAG = "udf" - -export default function UDFCatalog() { - const { udfs, isLoading, error } = useUDFs() - const onDragStart = (event: DragEvent, udf: UDF) => { - console.log("Dragging node", UDF_NODE_TAG) - event.dataTransfer.setData("application/reactflow", UDF_NODE_TAG) - event.dataTransfer.setData( - "application/json", - JSON.stringify({ - type: udf.key, - title: udf.key, - namespace: udf.namespace, - status: "offline", - isConfigured: false, - numberOfEvents: 0, - }) - ) - event.dataTransfer.effectAllowed = "move" - } - - if (!udfs || isLoading) { - return - } - - // We're just going to do very simple grouping of nodes by namespace - // Leave the complicated tree-grouping for later - - return ( -
- {error ? ( - - ) : isLoading ? ( - - ) : ( - - - {Object.entries(groupBy(udfs, "namespace")).map( - ([namespace, udfs], index) => { - return ( - - -
- {getIcon(namespace, { className: "size-5" })} - -
-
- -
- -
-
-
- ) - } - )} -
-
- )} -
- ) -} - -interface CatalogSectionProps extends React.HTMLAttributes { - udfs: UDF[] - dragHandler: (event: DragEvent, udf: UDF) => void -} -function CatalogSection({ udfs, dragHandler }: CatalogSectionProps) { - return ( -
- {udfs.map((udf, idx) => { - return ( - dragHandler(event, udf)} - draggable - udf={udf} - /> - ) - })} -
- ) -} - -interface CatalogItemProps extends React.HTMLAttributes { - udf: UDF -} - -function CatalogItem({ udf, ...props }: CatalogItemProps) { - return ( -
-
- {getIcon(udf.key, { className: "size-5" })} -
-
- {undoSlugify(udf.key)} -
-
- ) -}