mirror of
https://github.com/wu736139669/hapi.git
synced 2026-08-05 06:24:37 +00:00
refactor: move path utilities to utils directory
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import type { ReactNode } from 'react'
|
||||
import type { SessionMetadataSummary } from '@/types/api'
|
||||
import { BulbIcon, ClipboardIcon, EyeIcon, FileDiffIcon, GlobeIcon, PuzzleIcon, QuestionIcon, RocketIcon, SearchIcon, TerminalIcon, WrenchIcon } from '@/components/ToolCard/icons'
|
||||
import { basename, resolveDisplayPath } from '@/components/ToolCard/path'
|
||||
import { basename, resolveDisplayPath } from '@/utils/path'
|
||||
|
||||
const DEFAULT_ICON_CLASS = 'h-3.5 w-3.5'
|
||||
// Tool presentation registry for `hapi/web` (aligned with `hapi-app`).
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { ToolViewProps } from '@/components/ToolCard/views/_all'
|
||||
import { basename, resolveDisplayPath } from '@/components/ToolCard/path'
|
||||
import { basename, resolveDisplayPath } from '@/utils/path'
|
||||
|
||||
function isObject(value: unknown): value is Record<string, unknown> {
|
||||
return Boolean(value) && typeof value === 'object'
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import type { ToolViewComponent, ToolViewProps } from '@/components/ToolCard/views/_all'
|
||||
import { CodeBlock } from '@/components/CodeBlock'
|
||||
import { MarkdownRenderer } from '@/components/MarkdownRenderer'
|
||||
import { basename, resolveDisplayPath } from '@/components/ToolCard/path'
|
||||
import { basename, resolveDisplayPath } from '@/utils/path'
|
||||
|
||||
function isObject(value: unknown): value is Record<string, unknown> {
|
||||
return Boolean(value) && typeof value === 'object'
|
||||
|
||||
@@ -23,4 +23,3 @@ export function basename(path: string): string {
|
||||
const parts = normalized.split('/').filter(Boolean)
|
||||
return parts.length > 0 ? parts[parts.length - 1] : path
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user