switch IntegrationActions to function component
@@ -21,34 +21,41 @@ export interface IIntegrationActionsProps {
editHref?: H.LocationDescriptor;
}
-export class IntegrationActions extends React.Component<
+export const IntegrationActions: React.FunctionComponent<
IIntegrationActionsProps
-> {
- public render() {
+> = (
+ {
+ actions,
+ detailsHref,
+ editHref,
+ i18nEditBtn,
+ i18nViewBtn,
+ integrationId
+ }) => {
return (
<>
<ButtonLink
data-testid={'integration-actions-edit-button'}
className={'edit-integration-btn'}
- href={this.props.editHref}
+ href={editHref}
as={'default'}
>
- {this.props.i18nEditBtn}
+ {i18nEditBtn}
</ButtonLink>
<ButtonLink
data-testid={'integration-actions-view-button'}
className={'view-integration-btn'}
- href={this.props.detailsHref}
+ href={detailsHref}
as={'default'}
>
- {this.props.i18nViewBtn}
+ {i18nViewBtn}
</ButtonLink>
<DropdownKebab
className={'integration-actions__dropdown-kebab'}
- id={`integration-${this.props.integrationId}-action-menu`}
+ id={`integration-${integrationId}-action-menu`}
pullRight={true}
>
- {this.props.actions.map((a, idx) => (
+ {actions.map((a, idx) => (
<li role={'presentation'} key={idx}>
{a.href ? (
<Link
@@ -80,5 +87,4 @@ export class IntegrationActions extends React.Component<
</DropdownKebab>
</>
);
- }
-}
+};
