Compare commits
3 commits
bca9468392
...
086a9791d6
Author | SHA1 | Date | |
---|---|---|---|
086a9791d6 | |||
cd2a37c679 | |||
8aaab98785 |
3 changed files with 4 additions and 14 deletions
|
@ -14,6 +14,7 @@ Repository: https://www.coastalcommits.com/cswimr/cswimr-gauntlet-plugins
|
|||
id = 'tailwindcss-search-documentation'
|
||||
name = 'Search TailwindCSS Documentation'
|
||||
path = 'src/tailwindcss/src/search-documentation.tsx'
|
||||
icon = 'tailwindcss/list-icon.png'
|
||||
type = 'view'
|
||||
description = """
|
||||
Search TailwindCSS documentation from Gauntlet!
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
import { List } from "@project-gauntlet/api/components";
|
||||
import React, { ReactElement, useState } from "react";
|
||||
import documentation from "./documentation/tailwind-css";
|
||||
import { Clipboard } from "@project-gauntlet/api/helpers";
|
||||
import open from "../../../utils/open-url";
|
||||
|
||||
// @ts-expect-error gauntlet uses deno and not node
|
||||
|
@ -11,24 +10,13 @@ const denoCore: DenoCore = Deno[Deno.internal].core;
|
|||
export default function SearchDocumentation(): ReactElement {
|
||||
const [searchText, setSearchText] = useState<string | undefined>("");
|
||||
|
||||
//TODO - Migrate this to an Action, so that we can also have a copy to clipboard feature
|
||||
const onClick = async (url: string) => {
|
||||
await open(url);
|
||||
//await Clipboard.writeText(url);
|
||||
};
|
||||
|
||||
return (
|
||||
<List
|
||||
// actions={
|
||||
// <ActionPanel>
|
||||
// <Action
|
||||
// label="Copy URL to Clipboard"
|
||||
// onAction={async () => {
|
||||
// await Clipboard.writeText(item.url);
|
||||
// }}
|
||||
// />
|
||||
// </ActionPanel>
|
||||
// }
|
||||
>
|
||||
<List>
|
||||
<List.SearchBar
|
||||
placeholder={"Search TailwindCSS Documentation..."}
|
||||
value={searchText}
|
||||
|
|
|
@ -22,6 +22,7 @@ const open = async (url: string) => {
|
|||
// Yes, this function uses Deno. Yes, this repository uses Node.js for tooling.
|
||||
// Gauntlet runs loaded plugins in a Deno runtime, so this works fine.
|
||||
// Hop off Copilot I know this isn't using Node.js APIs
|
||||
console.log("Opening URL:", url);
|
||||
const platform = Deno.build.os;
|
||||
const cmd = getOpenCommand(platform);
|
||||
const process = new Deno.Command(cmd, {
|
||||
|
|
Loading…
Add table
Reference in a new issue