fix: harden admin and CMPP delivery workflows

This commit is contained in:
hectorzhao
2026-07-15 11:21:02 +08:00
parent 00b6d95752
commit e47432bc9d
34 changed files with 878 additions and 226 deletions
+1 -1
View File
@@ -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;
+4 -3
View File
@@ -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>
);
}
});