fix: harden admin and CMPP delivery workflows
This commit is contained in:
@@ -4,7 +4,7 @@ import { Pagination } from './PagePrimitives';
|
||||
|
||||
export type TableColumn<T> = {
|
||||
key: string;
|
||||
title: string;
|
||||
title: ReactNode;
|
||||
width?: string;
|
||||
align?: 'left' | 'center' | 'right';
|
||||
render: (record: T, index: number) => ReactNode;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { TextareaHTMLAttributes } from 'react';
|
||||
import { forwardRef, type TextareaHTMLAttributes } from 'react';
|
||||
|
||||
type TextareaProps = TextareaHTMLAttributes<HTMLTextAreaElement> & {
|
||||
label?: string;
|
||||
@@ -6,7 +6,7 @@ type TextareaProps = TextareaHTMLAttributes<HTMLTextAreaElement> & {
|
||||
error?: string;
|
||||
};
|
||||
|
||||
export function Textarea({ className = '', label, hint, error, id, ...props }: TextareaProps) {
|
||||
export const Textarea = forwardRef<HTMLTextAreaElement, TextareaProps>(function Textarea({ className = '', label, hint, error, id, ...props }, ref) {
|
||||
const textareaId = id ?? props.name;
|
||||
const required = Boolean(props.required);
|
||||
|
||||
@@ -21,10 +21,11 @@ export function Textarea({ className = '', label, hint, error, id, ...props }: T
|
||||
<textarea
|
||||
className={['ui-textarea', error ? 'ui-textarea--error' : ''].filter(Boolean).join(' ')}
|
||||
id={textareaId}
|
||||
ref={ref}
|
||||
{...props}
|
||||
/>
|
||||
{error ? <span className="ui-field__error">{error}</span> : null}
|
||||
{!error && hint ? <span className="ui-field__hint">{hint}</span> : null}
|
||||
</label>
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user