import { Button, Checkbox, Switch as HopeSwitch, FormControl, FormLabel, Heading, Input, VStack, Flex, Textarea, FormHelperText, } from "@hope-ui/solid" import { MaybeLoading, FolderChooseInput } from "~/components" import { useFetch, useRouter, useT } from "~/hooks" import { handleResp, notify, r } from "~/utils" import { Meta, PEmptyResp, PResp } from "~/types" import { createStore } from "solid-js/store" import { For, Show } from "solid-js" type ItemProps = { name: string sub?: boolean onSub: (val: boolean) => void help?: boolean } & ( | { type: "string"; value: string; onChange: (val: string) => void } | { type: "text"; value: string; onChange: (val: string) => void } | { type: "bool"; value: boolean; onChange: (val: boolean) => void } ) const Item = (props: ItemProps) => { const t = useT() return ( {t(`metas.${props.name}`)} {props.type === "string" ? ( props.onChange(e.currentTarget.value)} /> ) : props.type === "bool" ? ( props.onChange(e.currentTarget.checked)} /> ) : (