diff --git a/.changeset/ten-brooms-rhyme.md b/.changeset/ten-brooms-rhyme.md new file mode 100644 index 000000000..f1f3d6f5d --- /dev/null +++ b/.changeset/ten-brooms-rhyme.md @@ -0,0 +1,5 @@ +--- +"@assistant-ui/react-hook-form": patch +--- + +feat: add UseAssistantFormProps type diff --git a/apps/www/components/docs/ParametersTable.tsx b/apps/www/components/docs/ParametersTable.tsx index 24240c92e..ff3080657 100644 --- a/apps/www/components/docs/ParametersTable.tsx +++ b/apps/www/components/docs/ParametersTable.tsx @@ -5,10 +5,7 @@ type ParameterDef = { type: string; description: string; required?: boolean; - children?: Array<{ - type: string; - parameters: Array; - }>; + children?: Array; }; type ParameterProps = { @@ -35,36 +32,52 @@ const Parameter: FC = ({ parameter, isLast }) => {

{parameter.description}

{parameter.children?.map((property) => ( -
- {!!property.type && ( -

- {property.type} -

- )} - -
+ ))} ); }; +const ParametersList = ({ + parameters, +}: { parameters: Array }) => { + return parameters.map((parameter, idx) => ( + + )); +}; +const ParametersBox: FC = ({ type, parameters }) => { + return ( +
+ {!!type && ( +

+ {type} +

+ )} + +
+ ); +}; + type ParametersTableProps = { + type?: string; parameters: Array; }; -export const ParametersTable: FC = ({ parameters }) => { +export const ParametersTable: FC = ({ + type, + parameters, +}) => { return (
- {parameters.map((parameter, idx) => ( - - ))} + {type ? ( + + ) : ( + + )}
); }; diff --git a/apps/www/pages/reference/integrations/react-hook-form.mdx b/apps/www/pages/reference/integrations/react-hook-form.mdx index d7188ccbc..4e5ca3504 100644 --- a/apps/www/pages/reference/integrations/react-hook-form.mdx +++ b/apps/www/pages/reference/integrations/react-hook-form.mdx @@ -24,6 +24,7 @@ Drop-in replacement hook for `useForm` that adds support for `@assistant-ui/reac #### Properties = UseFormProps & {