Skip to content

Commit

Permalink
mv FileLinkProps to FileLink (#3634)
Browse files Browse the repository at this point in the history
  • Loading branch information
sqs authored Mar 30, 2024
1 parent cd85ae3 commit 1c935cf
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 15 deletions.
19 changes: 17 additions & 2 deletions vscode/webviews/Components/FileLink.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,27 @@
import classNames from 'classnames'
import type React from 'react'

import { displayLineRange, displayPath, webviewOpenURIForContextItem } from '@sourcegraph/cody-shared'
import type { FileLinkProps } from '../chat/components/EnhancedContext'
import {
type RangeData,
displayLineRange,
displayPath,
webviewOpenURIForContextItem,
} from '@sourcegraph/cody-shared'

import type { URI } from 'vscode-uri'
import { getVSCodeAPI } from '../utils/VSCodeApi'
import styles from './FileLink.module.css'

interface FileLinkProps {
uri: URI
repoName?: string
revision?: string
source?: string
range?: RangeData
title?: string
isTooLarge?: boolean
}

export const FileLink: React.FunctionComponent<FileLinkProps> = ({
uri,
range,
Expand Down
14 changes: 1 addition & 13 deletions vscode/webviews/chat/components/EnhancedContext.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import React from 'react'

import type { URI } from 'vscode-uri'

import type { ContextItem, RangeData } from '@sourcegraph/cody-shared'
import type { ContextItem } from '@sourcegraph/cody-shared'

import { FileLink } from '../../Components/FileLink'
import { getVSCodeAPI } from '../../utils/VSCodeApi'
Expand All @@ -14,16 +12,6 @@ export function useEnhancedContextEnabled(): boolean {
return React.useContext(EnhancedContextEnabled)
}

export interface FileLinkProps {
uri: URI
repoName?: string
revision?: string
source?: string
range?: RangeData
title?: string
isTooLarge?: boolean
}

export const EnhancedContext: React.FunctionComponent<{
contextFiles: ContextItem[]
className?: string
Expand Down

0 comments on commit 1c935cf

Please sign in to comment.