mirror of
https://github.com/baptisteArno/typebot.io.git
synced 2026-06-13 21:02:56 +08:00
♻️ Misc types improvement (#2120)
This commit is contained in:
parent
43bacc442c
commit
fe8469fcde
@ -360,7 +360,9 @@ const CredentialsItem = ({
|
||||
const groupCredentialsByType = (
|
||||
credentials: CredentialsInfo[],
|
||||
): Record<CredentialsInfo["type"], CredentialsInfo[]> => {
|
||||
const groupedCredentials: any = {};
|
||||
const groupedCredentials = {} as {
|
||||
[key in CredentialsInfo["type"]]: CredentialsInfo[];
|
||||
};
|
||||
credentials.forEach((cred) => {
|
||||
if (!groupedCredentials[cred.type]) {
|
||||
groupedCredentials[cred.type] = [];
|
||||
|
||||
@ -1,12 +1,17 @@
|
||||
import { Checkbox, Flex } from "@chakra-ui/react";
|
||||
import { Checkbox, type CheckboxProps, Flex } from "@chakra-ui/react";
|
||||
import React from "react";
|
||||
|
||||
type TableCheckBoxProps = {
|
||||
indeterminate: boolean;
|
||||
checked: boolean;
|
||||
} & Omit<CheckboxProps, "ref" | "isIndeterminate" | "isChecked">;
|
||||
|
||||
const TableCheckBox = (
|
||||
{ indeterminate, checked, ...rest }: any,
|
||||
{ indeterminate, checked, ...rest }: TableCheckBoxProps,
|
||||
ref: React.LegacyRef<HTMLInputElement>,
|
||||
) => {
|
||||
const defaultRef = React.useRef();
|
||||
const resolvedRef: any = ref || defaultRef;
|
||||
const resolvedRef = ref || defaultRef;
|
||||
|
||||
return (
|
||||
<Flex justify="center" data-testid="checkbox">
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
import { Link } from "@tanstack/react-router";
|
||||
import type { ReactNode } from "react";
|
||||
|
||||
export const NotFound = ({ children }: { children?: any }) => {
|
||||
export const NotFound = ({ children }: { children?: ReactNode }) => {
|
||||
return (
|
||||
<div className="space-y-2 p-2">
|
||||
<div className="text-gray-600 dark:text-gray-400">
|
||||
|
||||
@ -2,8 +2,8 @@ import type { Variable } from "./schemas";
|
||||
|
||||
const variableNameRegex = /\{\{([^{}]+)\}\}/g;
|
||||
|
||||
export const extractVariableIdReferencesInObject = (
|
||||
obj: any,
|
||||
export const extractVariableIdReferencesInObject = <T>(
|
||||
obj: T,
|
||||
existingVariables: Variable[],
|
||||
): string[] =>
|
||||
[...(JSON.stringify(obj).match(variableNameRegex) ?? [])].reduce<string[]>(
|
||||
|
||||
Loading…
Reference in New Issue
Block a user