import { useState } from "react"; import { readOnlineFlows } from "../../../controllers/API/flow"; import { FlowType } from "../../../types/flow"; import { useTable } from "../../../util/hook"; import { Button } from "../../bs-ui/button"; import { SearchInput } from "../../bs-ui/input"; import { Sheet, SheetContent, SheetTitle, SheetTrigger, } from "../../bs-ui/sheet"; import CardComponent from "../cardComponent"; import { useTranslation } from "react-i18next"; export default function SkillSheet({ select, children, onSelect }) { const [keyword, setKeyword] = useState(""); const { data: onlineFlows, loading, search, } = useTable({}, (param) => readOnlineFlows(param.page, param.keyword).then((res) => { return res; }) ); const handleSearch = (e) => { const { value } = e.target; setKeyword(value); search(value); }; const toCreateFlow = () => { window.open("/build/skills"); }; const { t } = useTranslation() return ( {children}
e.stopPropagation()}>
{t("build.addSkill")}
{onlineFlows[0] ? ( onlineFlows.map((flow, i) => ( {select.some((_) => _.id === flow.id) ? ( ) : ( )}
} /> )) ) : (

{t("build.empty")}

)}
); }