From c1d6095ce305650c5cd504ef5056d672aab0b2e0 Mon Sep 17 00:00:00 2001 From: cawcenter Date: Fri, 12 Dec 2025 19:00:37 -0500 Subject: [PATCH] Fix Build: Resolve Imports, Syntax Errors, and Add Missing UI Components --- .../admin/cartesian/JobLaunchpad.tsx | 1 + frontend/src/components/ui/badge.tsx | 41 +++---------------- frontend/src/components/ui/checkbox.tsx | 20 +++++++++ frontend/src/components/ui/input.tsx | 38 +++++------------ frontend/src/components/ui/label.tsx | 12 ++++++ frontend/src/components/ui/progress.tsx | 14 +++++++ frontend/src/components/ui/slider.tsx | 20 +++++++++ frontend/src/components/ui/switch.tsx | 33 +++++++++++++++ frontend/src/lib/utils.ts | 3 +- frontend/src/pages/admin/factory.astro | 2 +- .../src/pages/admin/media/templates.astro | 2 +- .../src/pages/admin/seo/articles/index.astro | 12 +++--- frontend/src/pages/admin/seo/campaigns.astro | 2 +- 13 files changed, 129 insertions(+), 71 deletions(-) create mode 100644 frontend/src/components/ui/checkbox.tsx create mode 100644 frontend/src/components/ui/label.tsx create mode 100644 frontend/src/components/ui/progress.tsx create mode 100644 frontend/src/components/ui/slider.tsx create mode 100644 frontend/src/components/ui/switch.tsx diff --git a/frontend/src/components/admin/cartesian/JobLaunchpad.tsx b/frontend/src/components/admin/cartesian/JobLaunchpad.tsx index 9eede6b..31702cc 100644 --- a/frontend/src/components/admin/cartesian/JobLaunchpad.tsx +++ b/frontend/src/components/admin/cartesian/JobLaunchpad.tsx @@ -201,6 +201,7 @@ export default function JobLaunchpad() { {jobStatus} )} + diff --git a/frontend/src/components/ui/badge.tsx b/frontend/src/components/ui/badge.tsx index 75d44f5..21caa14 100644 --- a/frontend/src/components/ui/badge.tsx +++ b/frontend/src/components/ui/badge.tsx @@ -1,39 +1,10 @@ + import * as React from "react" -import { cva, type VariantProps } from "class-variance-authority" import { cn } from "@/lib/utils" -const badgeVariants = cva( - "inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2", - { - variants: { - variant: { - default: - "border-transparent bg-primary text-primary-foreground hover:bg-primary/80", - secondary: - "border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80", - destructive: - "border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80", - outline: "text-foreground", - success: - "border-transparent bg-green-500 text-white hover:bg-green-600", - warning: - "border-transparent bg-yellow-500 text-white hover:bg-yellow-600", - }, - }, - defaultVariants: { - variant: "default", - }, - } -) +const Badge = React.forwardRef>(({ className, ...props }, ref) => ( +
+)) +Badge.displayName = "Badge" -export interface BadgeProps - extends React.HTMLAttributes, - VariantProps { } - -function Badge({ className, variant, ...props }: BadgeProps) { - return ( -
- ) -} - -export { Badge, badgeVariants } +export { Badge } diff --git a/frontend/src/components/ui/checkbox.tsx b/frontend/src/components/ui/checkbox.tsx new file mode 100644 index 0000000..7b25e65 --- /dev/null +++ b/frontend/src/components/ui/checkbox.tsx @@ -0,0 +1,20 @@ + +import * as React from "react" +import { cn } from "@/lib/utils" + +const Checkbox = React.forwardRef>( + ({ className, ...props }, ref) => ( + + ) +) +Checkbox.displayName = "Checkbox" + +export { Checkbox } diff --git a/frontend/src/components/ui/input.tsx b/frontend/src/components/ui/input.tsx index a36a049..9d77857 100644 --- a/frontend/src/components/ui/input.tsx +++ b/frontend/src/components/ui/input.tsx @@ -1,35 +1,19 @@ + import * as React from "react" import { cn } from "@/lib/utils" -export interface InputProps - extends React.InputHTMLAttributes { - label?: string - error?: string -} - -const Input = React.forwardRef( - ({ className, type, label, error, ...props }, ref) => { +const Input = React.forwardRef>( + ({ className, type, ...props }, ref) => { return ( -
- {label && ( - + - {error && ( -

{error}

- )} -
+ ref={ref} + {...props} + /> ) } ) diff --git a/frontend/src/components/ui/label.tsx b/frontend/src/components/ui/label.tsx new file mode 100644 index 0000000..a81af9f --- /dev/null +++ b/frontend/src/components/ui/label.tsx @@ -0,0 +1,12 @@ + +import * as React from "react" +import { cn } from "@/lib/utils" + +const Label = React.forwardRef>( + ({ className, ...props }, ref) => ( +