* remove create button for teams from calcom ui * migrate timezone select to features * remove trpc from phone and storybook provider * new-yarn.lock * fix imports + test file for select * fix platform timezone select to use Raw timezone select * fix timezone type import * use correct select in timezone-select.tsx - needs trpc version * fix lock and remove test-utils * fix log file * Updated yarn.lock * Fixed types * Fixed tests --------- Co-authored-by: Keith Williams <keithwillcode@gmail.com>
32 lines
925 B
TypeScript
32 lines
925 B
TypeScript
"use client";
|
|
|
|
import { useRouter } from "next/navigation";
|
|
|
|
import { CreateButtonWithTeamsList } from "@calcom/features/ee/teams/components/createButton/CreateButtonWithTeamsList";
|
|
import { useLocale } from "@calcom/lib/hooks/useLocale";
|
|
|
|
export const CreateNewWebhookButton = ({ isAdmin }: { isAdmin: boolean }) => {
|
|
const router = useRouter();
|
|
const { t } = useLocale();
|
|
const createFunction = (teamId?: number, platform?: boolean) => {
|
|
if (platform) {
|
|
router.push(`webhooks/new${platform ? `?platform=${platform}` : ""}`);
|
|
} else {
|
|
router.push(`webhooks/new${teamId ? `?teamId=${teamId}` : ""}`);
|
|
}
|
|
};
|
|
|
|
return (
|
|
<CreateButtonWithTeamsList
|
|
color="secondary"
|
|
subtitle={t("create_for").toUpperCase()}
|
|
isAdmin={isAdmin}
|
|
createFunction={createFunction}
|
|
data-testid="new_webhook"
|
|
includeOrg={true}
|
|
/>
|
|
);
|
|
};
|
|
|
|
export default CreateNewWebhookButton;
|