keycloak-scim/src/clients/advanced/SaveReset.tsx

24 lines
680 B
TypeScript
Raw Normal View History

import React from "react";
import { useTranslation } from "react-i18next";
2021-04-06 17:19:15 +00:00
import { ActionGroup, ActionGroupProps, Button } from "@patternfly/react-core";
2021-04-06 17:19:15 +00:00
type SaveResetProps = ActionGroupProps & {
name: string;
save: () => void;
reset: () => void;
};
2021-04-06 17:19:15 +00:00
export const SaveReset = ({ name, save, reset, ...rest }: SaveResetProps) => {
const { t } = useTranslation();
return (
2021-04-06 17:19:15 +00:00
<ActionGroup {...rest}>
<Button data-testid={name + "Save"} variant="tertiary" onClick={save}>
{t("common:save")}
</Button>
2021-03-12 16:30:14 +00:00
<Button data-testid={name + "Revert"} variant="link" onClick={reset}>
{t("common:revert")}
</Button>
</ActionGroup>
);
};