refactor[src/pages]: Add types to pages functions that didnt have it
This commit is contained in:
parent
54f1f5c504
commit
fff6e494db
9 changed files with 27 additions and 8 deletions
|
|
@ -8,7 +8,7 @@ import { CardComponent } from "../../components/cardComponent";
|
|||
import IconComponent from "../../components/genericIconComponent";
|
||||
import { getExamples } from "../../controllers/API";
|
||||
import { FlowType } from "../../types/flow";
|
||||
export default function CommunityPage() {
|
||||
export default function CommunityPage(): JSX.Element {
|
||||
const { flows, setTabId, downloadFlows, uploadFlows, addFlow } =
|
||||
useContext(TabsContext);
|
||||
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ const ConnectionLineComponent = ({
|
|||
toX,
|
||||
toY,
|
||||
connectionLineStyle = {}, // provide a default value for connectionLineStyle
|
||||
}: ConnectionLineComponentProps) => {
|
||||
}: ConnectionLineComponentProps): JSX.Element => {
|
||||
return (
|
||||
<g>
|
||||
<path
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ export default function DisclosureComponent({
|
|||
button: { title, Icon, buttons = [] },
|
||||
children,
|
||||
openDisc,
|
||||
}: DisclosureComponentType) {
|
||||
}: DisclosureComponentType): JSX.Element {
|
||||
return (
|
||||
<Disclosure as="div" key={title}>
|
||||
{({ open }) => (
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ const nodeTypes = {
|
|||
genericNode: GenericNode,
|
||||
};
|
||||
|
||||
export default function Page({ flow }: { flow: FlowType }) {
|
||||
export default function Page({ flow }: { flow: FlowType }): JSX.Element {
|
||||
let {
|
||||
updateFlow,
|
||||
uploadFlow,
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ import {
|
|||
import { classNames } from "../../../../utils/utils";
|
||||
import DisclosureComponent from "../DisclosureComponent";
|
||||
|
||||
export default function ExtraSidebar() {
|
||||
export default function ExtraSidebar(): JSX.Element {
|
||||
const { data } = useContext(typesContext);
|
||||
const { openPopUp } = useContext(PopUpContext);
|
||||
const { flows, tabId, uploadFlow, tabsState, saveFlow } =
|
||||
|
|
|
|||
|
|
@ -5,8 +5,10 @@ import IconComponent from "../../../../components/genericIconComponent";
|
|||
import { TabsContext } from "../../../../contexts/tabsContext";
|
||||
import EditNodeModal from "../../../../modals/EditNodeModal";
|
||||
import { classNames } from "../../../../utils/utils";
|
||||
import { nodeToolbarType } from "../../../../types/components";
|
||||
|
||||
const NodeToolbarComponent = (props) => {
|
||||
const NodeToolbarComponent = (props): JSX.Element => {
|
||||
console.log(props);
|
||||
const [nodeLength, setNodeLength] = useState(
|
||||
Object.keys(props.data.node.template).filter(
|
||||
(t) =>
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ import { TabsContext } from "../../contexts/tabsContext";
|
|||
import { getVersion } from "../../controllers/API";
|
||||
import Page from "./components/PageComponent";
|
||||
|
||||
export default function FlowPage() {
|
||||
export default function FlowPage(): JSX.Element {
|
||||
const { flows, tabId, setTabId } = useContext(TabsContext);
|
||||
const { id } = useParams();
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ import IconComponent from "../../components/genericIconComponent";
|
|||
import { Button } from "../../components/ui/button";
|
||||
import { USER_PROJECTS_HEADER } from "../../constants/constants";
|
||||
import { TabsContext } from "../../contexts/tabsContext";
|
||||
export default function HomePage() {
|
||||
export default function HomePage(): JSX.Element {
|
||||
const { flows, setTabId, downloadFlows, uploadFlows, addFlow, removeFlow } =
|
||||
useContext(TabsContext);
|
||||
|
||||
|
|
|
|||
|
|
@ -415,3 +415,20 @@ export type tweakType = {
|
|||
"PromptTemplate-iNj5W": object;
|
||||
"ConversationBufferMemory-JnodM": object;
|
||||
}
|
||||
|
||||
export type nodeToolbarType = {
|
||||
data: {
|
||||
id: string;
|
||||
type: string;
|
||||
node: {
|
||||
base_classes: string[];
|
||||
description: string;
|
||||
display_name: string;
|
||||
documentation: string;
|
||||
template: object;
|
||||
};
|
||||
value: void;
|
||||
};
|
||||
deleteNode: (idx: string) => void;
|
||||
openPopUp: (element: any) => void;
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue