Buckets:
| import { DialogSelect, type DialogSelectOption } from "../ui/dialog-select" | |
| import { createResource, createMemo } from "solid-js" | |
| import { useDialog } from "../ui/dialog" | |
| import { useSDK } from "../context/sdk" | |
| export type DialogSkillProps = { | |
| onSelect: (skill: string) => void | |
| } | |
| export function DialogSkill(props: DialogSkillProps) { | |
| const dialog = useDialog() | |
| const sdk = useSDK() | |
| dialog.setSize("large") | |
| const [skills] = createResource(async () => { | |
| const result = await sdk.client.app.skills() | |
| return result.data ?? [] | |
| }) | |
| const options = createMemo<DialogSelectOption<string>[]>(() => { | |
| const list = skills() ?? [] | |
| const maxWidth = Math.max(0, ...list.map((s) => s.name.length)) | |
| return list.map((skill) => ({ | |
| title: skill.name.padEnd(maxWidth), | |
| description: skill.description?.replace(/\s+/g, " ").trim(), | |
| value: skill.name, | |
| category: "Skills", | |
| onSelect: () => { | |
| props.onSelect(skill.name) | |
| dialog.clear() | |
| }, | |
| })) | |
| }) | |
| return <DialogSelect title="Skills" placeholder="Search skills..." options={options()} /> | |
| } | |
Xet Storage Details
- Size:
- 1.11 kB
- Xet hash:
- a95bcfe898eecb3f8fbd22cb7e9caf329542f96217215888f5f941f4983e4c2a
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.