Signed-off-by: James <james@jan.ai> Co-authored-by: James <james@jan.ai>
This commit is contained in:
parent
7f55c1bed1
commit
acc774dc80
@ -13,6 +13,8 @@ import { useClickOutside } from '@/hooks/useClickOutside'
|
||||
|
||||
import { usePath } from '@/hooks/usePath'
|
||||
|
||||
import { openFileTitle } from '@/utils/titleUtils'
|
||||
|
||||
import { activeThreadAtom } from '@/helpers/atoms/Thread.atom'
|
||||
|
||||
interface Props {
|
||||
@ -36,13 +38,6 @@ export default function CardSidebar({
|
||||
|
||||
useClickOutside(() => setMore(false), null, [menu, toggle])
|
||||
|
||||
let openFolderTitle: string = 'Open Containing Folder'
|
||||
if (isMac) {
|
||||
openFolderTitle = 'Show in Finder'
|
||||
} else if (isWindows) {
|
||||
openFolderTitle = 'Show in File Explorer'
|
||||
}
|
||||
|
||||
return (
|
||||
<div
|
||||
className={twMerge(
|
||||
@ -110,7 +105,7 @@ export default function CardSidebar({
|
||||
{title === 'Model' ? (
|
||||
<div className="flex flex-col">
|
||||
<span className="font-medium text-black dark:text-muted-foreground">
|
||||
{openFolderTitle}
|
||||
{openFileTitle()}
|
||||
</span>
|
||||
<span className="mt-1 text-muted-foreground">
|
||||
Opens thread.json. Changes affect this thread only.
|
||||
@ -118,7 +113,7 @@ export default function CardSidebar({
|
||||
</div>
|
||||
) : (
|
||||
<span className="text-bold text-black dark:text-muted-foreground">
|
||||
Show in Finder
|
||||
{openFileTitle()}
|
||||
</span>
|
||||
)}
|
||||
</>
|
||||
|
||||
@ -27,6 +27,8 @@ import { usePath } from '@/hooks/usePath'
|
||||
|
||||
import { showRightSideBarAtom } from '@/screens/Chat/Sidebar'
|
||||
|
||||
import { openFileTitle } from '@/utils/titleUtils'
|
||||
|
||||
import { activeThreadAtom } from '@/helpers/atoms/Thread.atom'
|
||||
|
||||
const TopBar = () => {
|
||||
@ -161,7 +163,7 @@ const TopBar = () => {
|
||||
className="text-muted-foreground"
|
||||
/>
|
||||
<span className="font-medium text-black dark:text-muted-foreground">
|
||||
Show in Finder
|
||||
{openFileTitle()}
|
||||
</span>
|
||||
</div>
|
||||
<div
|
||||
@ -206,7 +208,7 @@ const TopBar = () => {
|
||||
/>
|
||||
<div className="flex flex-col">
|
||||
<span className="font-medium text-black dark:text-muted-foreground">
|
||||
Show in Finder
|
||||
{openFileTitle()}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
9
web/utils/titleUtils.ts
Normal file
9
web/utils/titleUtils.ts
Normal file
@ -0,0 +1,9 @@
|
||||
export const openFileTitle = (): string => {
|
||||
if (isMac) {
|
||||
return 'Show in Finder'
|
||||
} else if (isWindows) {
|
||||
return 'Show in File Explorer'
|
||||
} else {
|
||||
return 'Open Containing Folder'
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user