import { useRouter } from "next/navigation"; import { useLocale } from "@calcom/lib/hooks/useLocale"; import { HttpError } from "@calcom/lib/http-error"; import { trpc } from "@calcom/trpc/react"; import type { IconName } from "@calcom/ui"; import { CreateButtonWithTeamsList, EmptyScreen as ClassicEmptyScreen, Icon, showToast } from "@calcom/ui"; type WorkflowExampleType = { Icon: IconName; text: string; }; function WorkflowExample(props: WorkflowExampleType) { const { Icon: iconName, text } = props; return (
{text}
); } export default function EmptyScreen(props: { isFilteredView: boolean }) { const { t } = useLocale(); const router = useRouter(); const createMutation = trpc.viewer.workflows.create.useMutation({ onSuccess: async ({ workflow }) => { await router.replace(`/workflows/${workflow.id}`); }, onError: (err) => { if (err instanceof HttpError) { const message = `${err.statusCode}: ${err.message}`; showToast(message, "error"); } if (err.data?.code === "UNAUTHORIZED") { const message = `${err.data.code}: You are not authorized to create this workflow`; showToast(message, "error"); } }, }); const workflowsExamples = [ { icon: "smartphone", text: t("workflow_example_1") }, { icon: "smartphone", text: t("workflow_example_2") }, { icon: "mail", text: t("workflow_example_3") }, { icon: "mail", text: t("workflow_example_4") }, { icon: "mail", text: t("workflow_example_5") }, { icon: "smartphone", text: t("workflow_example_6") }, ] as const; // new workflow example when 'after meetings ends' trigger is implemented: Send custom thank you email to attendee after event (Smile icon), if (props.isFilteredView) { return ; } return ( <>

{t("workflows")}

{t("no_workflows_description")}

createMutation.mutate({ teamId })} buttonText={t("create_workflow")} isPending={createMutation.isPending} includeOrg={true} />
{workflowsExamples.map((example, index) => ( ))}
); }