feat: add temporal context and contextual help
This commit is contained in:
@@ -12,11 +12,19 @@ type FormFieldProps = PlatformInterfaceIdentityProps & {
|
||||
children: ReactNode;
|
||||
};
|
||||
|
||||
export default function FormField({ label, help, documentation, children, interfaceId, helpTopicId }: FormFieldProps) {
|
||||
export default function FormField({ label, help, documentation, children, interfaceId, helpContextId, helpTopicId }: FormFieldProps) {
|
||||
const { translateText } = usePlatformLanguage();
|
||||
const renderedLabel = typeof label === "string" ? translateText(label) : label;
|
||||
return (
|
||||
<label className="form-field" data-interface-id={interfaceId} data-help-topic-id={helpTopicId}>
|
||||
<label
|
||||
className="form-field"
|
||||
data-help-scope="field"
|
||||
data-interface-id={interfaceId}
|
||||
data-help-context-id={helpContextId ?? documentation?.contextId}
|
||||
data-help-topic-id={helpTopicId ?? documentation?.topicId}
|
||||
data-help-documentation-type={documentation?.documentationType}
|
||||
data-help-key={typeof label === "string" ? label : undefined}
|
||||
>
|
||||
<FieldLabel className="form-label" help={help ?? helpForFieldLabel(label)} documentation={documentation}>{renderedLabel}</FieldLabel>
|
||||
{children}
|
||||
</label>
|
||||
|
||||
Reference in New Issue
Block a user