mirror of
https://github.com/formbricks/formbricks.git
synced 2026-04-28 12:42:44 -05:00
e2a6631b64
Co-authored-by: Matti Nannt <mail@matthiasnannt.com>
30 lines
703 B
TypeScript
30 lines
703 B
TypeScript
"use client";
|
|
|
|
import React from "react";
|
|
import { Controller, useFormContext } from "react-hook-form";
|
|
import { OTPInput } from "@formbricks/ui/OTPInput";
|
|
|
|
const TwoFactor = () => {
|
|
const { control } = useFormContext();
|
|
|
|
return (
|
|
<>
|
|
<div className="mb-2 transition-all duration-500 ease-in-out">
|
|
<label htmlFor="totp" className="sr-only">
|
|
Two-factor authentication code
|
|
</label>
|
|
|
|
<Controller
|
|
control={control}
|
|
name="totpCode"
|
|
render={({ field }) => (
|
|
<OTPInput value={field.value ?? ""} onChange={field.onChange} valueLength={6} />
|
|
)}
|
|
/>
|
|
</div>
|
|
</>
|
|
);
|
|
};
|
|
|
|
export default TwoFactor;
|