Fix Build: Resolve Imports, Syntax Errors, and Add Missing UI Components

This commit is contained in:
cawcenter
2025-12-12 19:00:37 -05:00
parent 73f591e883
commit c1d6095ce3
13 changed files with 129 additions and 71 deletions

View File

@@ -201,6 +201,7 @@ export default function JobLaunchpad() {
{jobStatus}
</div>
)}
</div>
</CardContent>
</Card>
</div>

View File

@@ -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<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(({ className, ...props }, ref) => (
<div ref={ref} className={cn("inline-flex items-center rounded-md 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", className)} {...props} />
))
Badge.displayName = "Badge"
export interface BadgeProps
extends React.HTMLAttributes<HTMLDivElement>,
VariantProps<typeof badgeVariants> { }
function Badge({ className, variant, ...props }: BadgeProps) {
return (
<div className={cn(badgeVariants({ variant }), className)} {...props} />
)
}
export { Badge, badgeVariants }
export { Badge }

View File

@@ -0,0 +1,20 @@
import * as React from "react"
import { cn } from "@/lib/utils"
const Checkbox = React.forwardRef<HTMLInputElement, React.InputHTMLAttributes<HTMLInputElement>>(
({ className, ...props }, ref) => (
<input
type="checkbox"
className={cn(
"peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",
className
)}
ref={ref}
{...props}
/>
)
)
Checkbox.displayName = "Checkbox"
export { Checkbox }

View File

@@ -1,35 +1,19 @@
import * as React from "react"
import { cn } from "@/lib/utils"
export interface InputProps
extends React.InputHTMLAttributes<HTMLInputElement> {
label?: string
error?: string
}
const Input = React.forwardRef<HTMLInputElement, InputProps>(
({ className, type, label, error, ...props }, ref) => {
const Input = React.forwardRef<HTMLInputElement, React.InputHTMLAttributes<HTMLInputElement>>(
({ className, type, ...props }, ref) => {
return (
<div className="space-y-1">
{label && (
<label className="text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70">
{label}
</label>
)}
<input
type={type}
className={cn(
"flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",
error && "border-destructive",
className
)}
ref={ref}
{...props}
/>
{error && (
<p className="text-sm text-destructive">{error}</p>
)}
</div>
)
}
)

View File

@@ -0,0 +1,12 @@
import * as React from "react"
import { cn } from "@/lib/utils"
const Label = React.forwardRef<HTMLLabelElement, React.LabelHTMLAttributes<HTMLLabelElement>>(
({ className, ...props }, ref) => (
<label ref={ref} className={cn("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70", className)} {...props} />
)
)
Label.displayName = "Label"
export { Label }

View File

@@ -0,0 +1,14 @@
import * as React from "react"
import { cn } from "@/lib/utils"
// Simplified Progress without radix for speed, or if radix is missing
const Progress = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement> & { value?: number }>(
({ className, value, ...props }, ref) => (
<div ref={ref} className={cn("relative h-4 w-full overflow-hidden rounded-full bg-secondary", className)} {...props}>
<div className="h-full w-full flex-1 bg-primary transition-all" style={{ transform: `translateX(-${100 - (value || 0)}%)` }} />
</div>
)
)
Progress.displayName = "Progress"
export { Progress }

View File

@@ -0,0 +1,20 @@
import * as React from "react"
import { cn } from "@/lib/utils"
const Slider = React.forwardRef<HTMLInputElement, React.InputHTMLAttributes<HTMLInputElement>>(
({ className, ...props }, ref) => (
<input
type="range"
className={cn(
"w-full h-2 bg-gray-200 rounded-lg appearance-none cursor-pointer dark:bg-gray-700",
className
)}
ref={ref}
{...props}
/>
)
)
Slider.displayName = "Slider"
export { Slider }

View File

@@ -0,0 +1,33 @@
import * as React from "react"
import type { Primitive } from "@radix-ui/react-primitive"
// Simplified Switch to avoid Radix dependency issues if not installed, or use standard div toggle
import { cn } from "@/lib/utils"
const Switch = React.forwardRef<HTMLButtonElement, React.ButtonHTMLAttributes<HTMLButtonElement> & { checked?: boolean, onCheckedChange?: (checked: boolean) => void }>(
({ className, checked, onCheckedChange, ...props }, ref) => (
<button
type="button"
role="switch"
aria-checked={checked}
ref={ref}
onClick={() => onCheckedChange?.(!checked)}
className={cn(
"peer inline-flex h-[24px] w-[44px] shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",
checked ? "bg-primary" : "bg-slate-700",
className
)}
{...props}
>
<span
className={cn(
"pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0",
checked ? "translate-x-5 bg-white" : "translate-x-0 bg-slate-400"
)}
/>
</button>
)
)
Switch.displayName = "Switch"
export { Switch }

View File

@@ -1,4 +1,5 @@
import { clsx, type ClassValue } from "clsx"
import { type ClassValue, clsx } from "clsx"
import { twMerge } from "tailwind-merge"
export function cn(...inputs: ClassValue[]) {

View File

@@ -122,7 +122,7 @@ import BaseLayout from '../../layouts/BaseLayout.astro';
<div class="spintax-split">
<div class="spintax-input">
<label>Raw Spintax</label>
<textarea id="spintaxInput" placeholder="{Hello|Hi} {World|Friend}...">{The best {solar|renewable energy} {service|solution} in {City}, {State}.|{City} homeowners trust us for {premium|top-quality} {solar|clean energy} {installation|systems}.}</textarea>
<textarea id="spintaxInput" placeholder="{Hello|Hi} {World|Friend}...">{`{The best {solar|renewable energy} {service|solution} in {City}, {State}.|{City} homeowners trust us for {premium|top-quality} {solar|clean energy} {installation|systems}.}`}</textarea>
</div>
<div class="spintax-output">
<label>Live Preview</label>

View File

@@ -1,5 +1,5 @@
---
import AdminLayout from '../../../layouts/AdminLayout.astro';
import AdminLayout from '@/layouts/AdminLayout.astro';
import ImageTemplateEditor from '../../../components/admin/ImageTemplateEditor';
---

View File

@@ -1,8 +1,10 @@
```
---
import AdminLayout from '../../../layouts/AdminLayout.astro';
import ArticleGenerator from '../../../components/admin/ArticleGenerator';
import Layout from '@/layouts/AdminLayout.astro';
import ArticleList from '@/components/admin/seo/ArticleList';
---
<AdminLayout title="Generated Articles">
<ArticleGenerator client:load />
</AdminLayout>
<Layout title="Generated Articles">
<ArticleList client:load />
</Layout>
```

View File

@@ -1,5 +1,5 @@
---
import AdminLayout from '../../../layouts/AdminLayout.astro';
import AdminLayout from '@/layouts/AdminLayout.astro';
import CampaignManager from '../../../components/admin/CampaignManager';
---