Skip to content

Commit

Permalink
fix(mrc): clipboard props typing
Browse files Browse the repository at this point in the history
ref: 14577

Signed-off-by: Tristan WAGNER <[email protected]>
  • Loading branch information
tristanwagner committed Dec 16, 2024
1 parent 28605bf commit 5e4cf0c
Showing 1 changed file with 12 additions and 4 deletions.
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}
/>
);
};

0 comments on commit 5e4cf0c

Please sign in to comment.