UNPKG

ai-native-form

Version:

AI-powered React form assistant with GPT-4, speech input, and schema auto-generation.

7 lines (6 loc) 946 B
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; export const FillButton = ({ onClick, disabled = false, loading = false, label = 'Fill with AI', className = '', }) => (_jsx("button", { type: "button", onClick: onClick, disabled: disabled || loading, className: `px-4 py-2 rounded-lg font-semibold transition focus:outline-none ` + (disabled || loading ? 'bg-gray-300 text-gray-600 cursor-not-allowed' : 'bg-blue-600 hover:bg-blue-700 text-white') + (className ? ` ${className}` : ''), children: loading ? (_jsxs("svg", { className: "animate-spin h-5 w-5 mx-auto", xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", children: [_jsx("circle", { className: "opacity-25", cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4" }), _jsx("path", { className: "opacity-75", fill: "currentColor", d: "M4 12a8 8 0 018-8v4a4 4 0 00-4 4H4z" })] })) : (label) }));