- Fix PPTX/PDF export: Puppeteer URL port mismatch (80 → 3000) - Fix backend export_utils to use NEXT_INTERNAL_URL env var - Add Chromium to frontend Dockerfile for Docker-based export - Fix slide edit socket hang up with asyncio.wait_for() timeouts - Add FastAPI StaticFiles mounts for /static and /app_data - Add Next.js rewrite for /static/ to proxy to backend - Show template thumbnail in master decks admin page - Add error logging to ReviewWorkflow component - Add Docker env vars for web service (APP_DATA_DIRECTORY, app_data volume) - Add project README in English Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
36 lines
1.1 KiB
TypeScript
36 lines
1.1 KiB
TypeScript
"use client"
|
|
|
|
import * as React from "react"
|
|
import { cn } from "@/lib/utils"
|
|
import { Check } from "lucide-react"
|
|
|
|
export interface CheckboxProps
|
|
extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "onChange"> {
|
|
checked?: boolean
|
|
onCheckedChange?: (checked: boolean) => void
|
|
}
|
|
|
|
const Checkbox = React.forwardRef<HTMLButtonElement, CheckboxProps>(
|
|
({ className, checked = false, onCheckedChange, ...props }, ref) => {
|
|
return (
|
|
<button
|
|
ref={ref}
|
|
role="checkbox"
|
|
aria-checked={checked}
|
|
type="button"
|
|
onClick={() => onCheckedChange?.(!checked)}
|
|
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",
|
|
checked && "bg-primary text-primary-foreground",
|
|
className
|
|
)}
|
|
{...props}
|
|
>
|
|
{checked && <Check className="h-3.5 w-3.5" />}
|
|
</button>
|
|
)
|
|
}
|
|
)
|
|
Checkbox.displayName = "Checkbox"
|
|
|
|
export { Checkbox }
|