Skip to content

Commit fadbbba

Browse files
committed
fix: code review
1 parent f409f3e commit fadbbba

File tree

1 file changed

+3
-19
lines changed
  • packages/components/react/src/core/Terminal

1 file changed

+3
-19
lines changed

packages/components/react/src/core/Terminal/index.tsx

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -10,31 +10,15 @@ export interface TerminalRef {
1010
reloadStyles: () => void;
1111
}
1212

13-
export interface TerminalProps {
13+
export interface TerminalProps extends ComponentProps<'div'> {
1414
theme: 'dark' | 'light';
15-
className?: string;
16-
id?: string;
17-
role?: ComponentProps<'div'>['role'];
18-
'aria-labelledby'?: string;
1915
readonly?: boolean;
2016
onTerminalReady?: (terminal: XTerm) => void;
2117
onTerminalResize?: (cols: number, rows: number) => void;
2218
}
2319

2420
export const Terminal = forwardRef<TerminalRef, TerminalProps>(
25-
(
26-
{
27-
theme,
28-
className,
29-
id,
30-
role,
31-
'aria-labelledby': ariaLabelledby,
32-
readonly = true,
33-
onTerminalReady,
34-
onTerminalResize,
35-
},
36-
ref,
37-
) => {
21+
({ theme, readonly = true, onTerminalReady, onTerminalResize, ...props }, ref) => {
3822
const divRef = useRef<HTMLDivElement>(null);
3923
const terminalRef = useRef<XTerm>();
4024

@@ -94,7 +78,7 @@ export const Terminal = forwardRef<TerminalRef, TerminalProps>(
9478
};
9579
}, []);
9680

97-
return <div id={id} role={role} aria-labelledby={ariaLabelledby} className={className} ref={divRef} />;
81+
return <div {...props} ref={divRef} />;
9882
},
9983
);
10084

0 commit comments

Comments
 (0)