import prompts from "prompts"; import { listCollections } from "../utils/list-collections.js"; import { formatWithPrettier } from "../utils/prettier.js"; import { collectionListTemplate } from "./shared/collection-list.js"; export const listTemplate = async ( action_name: string, newfilefullpath: string ): Promise => { const response = await prompts({ type: "autocomplete", name: "collection", message: "Which sealious collection do you want to list?", choices: ( await listCollections() ).map((collection) => ({ title: collection, value: collection, })), }); const collection_name = response.collection as string; const result = await collectionListTemplate( collection_name, action_name, newfilefullpath ); return formatWithPrettier(result); };