= useCallback(
+ (e) => {
+ // @ts-ignore
+ setIsValidVideo(e.target.duration <= maxVideoLength);
+ registerVideo.onChange({
+ target: {
+ name: 'isValidVideo',
+ // @ts-ignore
+ value: String(e.target.duration <= maxVideoLength),
+ },
+ });
+ },
+ [maxVideoLength, registerVideo]
+ );
+
+ if (!maxVideoLength || !video || video.indexOf('mp4') === -1) {
+ return null;
+ }
+
+ return (
+ <>
+ {isValidVideo === false && (
+
+ Video length is invalid, must be up to {maxVideoLength} seconds
+
+ )}
+
+ >
+ );
+};
+
+const TikTokSettings: FC<{ values?: any }> = (props) => {
const { register, control } = useSettings();
+
return (
+