From 7e4e6f6e51876406a72531687bbbd70c86d05463 Mon Sep 17 00:00:00 2001 From: Jay V Date: Tue, 8 Jul 2025 17:18:28 -0400 Subject: docs: share page bugs --- packages/web/src/components/share/part.tsx | 56 +++++++++++++++++++++++++++--- 1 file changed, 52 insertions(+), 4 deletions(-) (limited to 'packages/web/src/components/share') diff --git a/packages/web/src/components/share/part.tsx b/packages/web/src/components/share/part.tsx index 3ee2c61a3..cff9b42b0 100644 --- a/packages/web/src/components/share/part.tsx +++ b/packages/web/src/components/share/part.tsx @@ -1,20 +1,22 @@ -import { createMemo, createSignal, For, Match, Show, Switch, type JSX, type ParentProps } from "solid-js" +import { For, Show, Match, Switch, type JSX, createMemo, createSignal, type ParentProps } from "solid-js" import { - IconCheckCircle, - IconChevronDown, - IconChevronRight, IconHashtag, IconSparkles, IconGlobeAlt, IconDocument, IconQueueList, + IconUserCircle, IconCommandLine, + IconCheckCircle, + IconChevronDown, + IconChevronRight, IconDocumentPlus, IconPencilSquare, IconRectangleStack, IconMagnifyingGlass, IconDocumentMagnifyingGlass, } from "../icons" +import { IconMeta, IconOpenAI, IconGemini, IconAnthropic } from "../icons/custom" import styles from "./part.module.css" import type { MessageV2 } from "opencode/session/message-v2" import { ContentText } from "./content-text" @@ -65,6 +67,15 @@ export function Part(props: PartProps) { }} > + + + + + + + + {model => } + @@ -130,6 +141,14 @@ export function Part(props: PartProps) { )} + {props.message.role === "user" && props.part.type === "file" && ( +
+ Read + + {props.part.filename} + +
+ )} {props.part.type === "step-start" && props.message.role === "assistant" && (
{props.message.providerID}
@@ -662,3 +681,32 @@ function flattenToolArgs(obj: any, prefix: string = ""): Array<[string, any]> { return entries } + +function getProvider(model: string) { + const lowerModel = model.toLowerCase() + + if (/claude|anthropic/.test(lowerModel)) return "anthropic" + if (/gpt|o[1-4]|codex|openai/.test(lowerModel)) return "openai" + if (/gemini|palm|bard|google/.test(lowerModel)) return "gemini" + if (/llama|meta/.test(lowerModel)) return "meta" + + return "any" +} + +export function ProviderIcon(props: { model: string; size?: number }) { + const provider = getProvider(props.model) + const size = props.size || 16 + return ( + }> + + + + + + + + + + + ) +} -- cgit v1.2.3