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

24 lines
655 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) => {
2021-05-25 10:04:58 +00:00
const { t } = useTranslation("common");
return (
2021-04-06 17:19:15 +00:00
<ActionGroup {...rest}>
2021-05-25 10:04:58 +00:00
<Button data-testid={name + "Save"} onClick={save}>
{t("save")}
</Button>
2021-03-12 16:30:14 +00:00
<Button data-testid={name + "Revert"} variant="link" onClick={reset}>
2021-05-25 10:04:58 +00:00
{t("revert")}
</Button>
</ActionGroup>
);
};