-
Notifications
You must be signed in to change notification settings - Fork 98
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(mrc): clipboard props typing (#14578)
ref: 14577 Signed-off-by: Tristan WAGNER <[email protected]>
- Loading branch information
1 parent
427b675
commit 8bfca44
Showing
1 changed file
with
12 additions
and
4 deletions.
There are no files selected for viewing
16 changes: 12 additions & 4 deletions
16
packages/manager-react-components/src/components/clipboard/clipboard.component.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,26 @@ | ||
import { OdsClipboard as OdsClipboardAttribute } from '@ovhcloud/ods-components'; | ||
import { JSX } from '@ovhcloud/ods-components'; | ||
import { OdsClipboard } from '@ovhcloud/ods-components/react'; | ||
import React from 'react'; | ||
import React, { HTMLAttributes, RefAttributes } from 'react'; | ||
import { useTranslation } from 'react-i18next'; | ||
import { StyleReactProps } from '@ovhcloud/ods-components/react/dist/types/react-component-lib/interfaces'; | ||
import './translations'; | ||
|
||
export const Clipboard: React.FC<Partial<OdsClipboardAttribute>> = (props) => { | ||
export const Clipboard: React.FC< | ||
Partial< | ||
JSX.OdsClipboard & | ||
HTMLAttributes<HTMLOdsClipboardElement> & | ||
StyleReactProps & | ||
RefAttributes<HTMLOdsClipboardElement> | ||
> | ||
> = (props) => { | ||
const { t } = useTranslation('clipboard'); | ||
|
||
return ( | ||
<OdsClipboard | ||
{...props} | ||
data-testid="clipboard" | ||
labelCopySuccess={t('clipboard_copy_success')} | ||
labelCopy={t('clipboard_copy')} | ||
{...props} | ||
/> | ||
); | ||
}; |