diff options
author | crupest <crupest@outlook.com> | 2023-07-20 20:44:15 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2023-07-20 20:44:15 +0800 |
commit | 0e183074b326cf04a23ae1f1ba8dcc56166df485 (patch) | |
tree | 87963dbe54b018ee0573cd77e674d32c23d8ba7f /FrontEnd/src/views/common/Card.tsx | |
parent | adc91a81fe53fdbc3d63065baa0b56862c104824 (diff) | |
download | timeline-0e183074b326cf04a23ae1f1ba8dcc56166df485.tar.gz timeline-0e183074b326cf04a23ae1f1ba8dcc56166df485.tar.bz2 timeline-0e183074b326cf04a23ae1f1ba8dcc56166df485.zip |
...
Diffstat (limited to 'FrontEnd/src/views/common/Card.tsx')
-rw-r--r-- | FrontEnd/src/views/common/Card.tsx | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/FrontEnd/src/views/common/Card.tsx b/FrontEnd/src/views/common/Card.tsx index ebbce77e..50632006 100644 --- a/FrontEnd/src/views/common/Card.tsx +++ b/FrontEnd/src/views/common/Card.tsx @@ -1,19 +1,21 @@ +import { ComponentPropsWithoutRef, Ref } from "react"; import classNames from "classnames"; -import * as React from "react"; import "./Card.css"; -function _Card( - { - className, - children, - ...otherProps - }: React.PropsWithChildren<React.HTMLAttributes<HTMLDivElement>>, - ref: React.ForwardedRef<HTMLDivElement> -): React.ReactElement | null { +interface CardProps extends ComponentPropsWithoutRef<"div"> { + containerRef: Ref<HTMLDivElement>; +} + +export default function Card({ + className, + children, + containerRef, + ...otherProps +}: CardProps) { return ( <div - ref={ref} + ref={containerRef} className={classNames("cru-card", className)} {...otherProps} > @@ -21,7 +23,3 @@ function _Card( </div> ); } - -const Card = React.forwardRef(_Card); - -export default Card; |