feat: add SPA, serve at /app/, update Dockerfile and README
- React + TanStack Router + shadcn/ui SPA under spa/ - serve spa/dist at /app/ with index.html fallback for client routing - Dockerfile: node build stage for SPA, copy dist into runtime image - README: document SPA, CORS_ORIGINS env var, architecture entry - vite base set to /app/, manifest.json paths fixed
This commit is contained in:
34
spa/src/components/star-rating.tsx
Normal file
34
spa/src/components/star-rating.tsx
Normal file
@@ -0,0 +1,34 @@
|
||||
import { Star } from "lucide-react"
|
||||
import { cn } from "@/lib/utils"
|
||||
|
||||
type StarRatingProps = {
|
||||
value: number
|
||||
onChange: (value: number) => void
|
||||
size?: "sm" | "md" | "lg"
|
||||
}
|
||||
|
||||
const sizes = { sm: "size-5", md: "size-8", lg: "size-10" }
|
||||
|
||||
export function StarRating({ value, onChange, size = "lg" }: StarRatingProps) {
|
||||
return (
|
||||
<div className="flex gap-1">
|
||||
{[1, 2, 3, 4, 5].map((star) => (
|
||||
<button
|
||||
key={star}
|
||||
type="button"
|
||||
onClick={() => onChange(star)}
|
||||
className="transition-transform active:scale-90"
|
||||
>
|
||||
<Star
|
||||
className={cn(
|
||||
sizes[size],
|
||||
star <= value
|
||||
? "fill-amber-500 text-amber-500 aero-star-filled"
|
||||
: "text-muted-foreground/30",
|
||||
)}
|
||||
/>
|
||||
</button>
|
||||
))}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user