mirror of
https://github.com/shumaiOne/shumai.git
synced 2026-11-26 10:55:27 +00:00
Merge pull request #46 from shumaiOne/feat/system-colors-sidebar-settings
feat(ui): migrate settings, sidebar, and cards to system colors
This commit is contained in:
@@ -3,11 +3,11 @@ import type { UserInfo } from '@/dtos/team'
|
|||||||
import { client } from '@/ui/api/client'
|
import { client } from '@/ui/api/client'
|
||||||
import { Button } from '@/ui/components/ui/button'
|
import { Button } from '@/ui/components/ui/button'
|
||||||
import {
|
import {
|
||||||
Dialog,
|
Dialog,
|
||||||
DialogContent,
|
DialogContent,
|
||||||
DialogDescription,
|
DialogDescription,
|
||||||
DialogHeader,
|
DialogHeader,
|
||||||
DialogTitle,
|
DialogTitle,
|
||||||
} from '@/ui/components/ui/dialog'
|
} from '@/ui/components/ui/dialog'
|
||||||
import { Separator } from '@/ui/components/ui/separator'
|
import { Separator } from '@/ui/components/ui/separator'
|
||||||
import { formatTimeAgo } from '@/ui/lib/time'
|
import { formatTimeAgo } from '@/ui/lib/time'
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ export const DualSidebar: React.FC<DualSidebarProps> = ({ children }) => {
|
|||||||
variant="ghost"
|
variant="ghost"
|
||||||
size="icon"
|
size="icon"
|
||||||
onClick={toggleMobileMenu}
|
onClick={toggleMobileMenu}
|
||||||
className="md:hidden fixed top-4 left-4 z-50 rounded-md bg-white/50 dark:bg-slate-800/50 backdrop-blur-sm text-slate-800 dark:text-slate-200 focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-500"
|
className="md:hidden fixed top-4 left-4 z-50 rounded-md bg-sidebar/50 backdrop-blur-sm text-sidebar-foreground focus:outline-none focus-visible:ring-2 focus-visible:ring-sidebar-ring"
|
||||||
aria-label="Open navigation menu"
|
aria-label="Open navigation menu"
|
||||||
aria-expanded={isMobileMenuOpen}
|
aria-expanded={isMobileMenuOpen}
|
||||||
>
|
>
|
||||||
@@ -100,9 +100,9 @@ export const DualSidebar: React.FC<DualSidebarProps> = ({ children }) => {
|
|||||||
<aside
|
<aside
|
||||||
className={`fixed inset-y-0 left-0 z-40 flex transition-transform duration-300 ease-in-out ${isMobileMenuOpen ? 'translate-x-0' : '-translate-x-full'} md:translate-x-0`}
|
className={`fixed inset-y-0 left-0 z-40 flex transition-transform duration-300 ease-in-out ${isMobileMenuOpen ? 'translate-x-0' : '-translate-x-full'} md:translate-x-0`}
|
||||||
>
|
>
|
||||||
<div className="absolute bottom-0 w-full h-[70dvh] bg-linear-to-t from-orange-400/10 to-transparent"></div>
|
<div className="absolute bottom-0 w-full h-[70dvh] bg-linear-to-t from-sidebar-primary/10 to-transparent"></div>
|
||||||
{/* Level 1: Icon Bar */}
|
{/* Level 1: Icon Bar */}
|
||||||
<nav className="w-16 bg-slate-100 dark:bg-slate-900 border-r border-slate-200 dark:border-slate-800 flex flex-col items-center pb-4 pt-0 space-y-2 flex-shrink-0">
|
<nav className="w-16 bg-sidebar border-r border-sidebar-border flex flex-col items-center pb-4 pt-0 space-y-2 flex-shrink-0">
|
||||||
<div className="flex-1 w-full flex flex-col items-center space-y-5 pt-1">
|
<div className="flex-1 w-full flex flex-col items-center space-y-5 pt-1">
|
||||||
<TooltipProvider>
|
<TooltipProvider>
|
||||||
{sidebarItems.map((item, index) => (
|
{sidebarItems.map((item, index) => (
|
||||||
@@ -116,8 +116,8 @@ export const DualSidebar: React.FC<DualSidebarProps> = ({ children }) => {
|
|||||||
aria-expanded={activeItem === index}
|
aria-expanded={activeItem === index}
|
||||||
className={`relative w-12 h-12 [&_svg:not([class*='size-'])]:size-6 transition-all duration-200 ${
|
className={`relative w-12 h-12 [&_svg:not([class*='size-'])]:size-6 transition-all duration-200 ${
|
||||||
activeItem === index
|
activeItem === index
|
||||||
? 'bg-blue-600 text-white shadow-lg hover:bg-blue-600 hover:text-white'
|
? 'bg-sidebar-primary text-sidebar-primary-foreground shadow-lg hover:bg-sidebar-primary hover:text-sidebar-primary-foreground'
|
||||||
: 'text-slate-400 hover:text-slate-500 dark:hover:text-slate-400 dark:text-slate-500 hover:bg-slate-200 dark:hover:bg-slate-800'
|
: 'text-sidebar-foreground/60 hover:text-sidebar-foreground hover:bg-sidebar-accent'
|
||||||
}`}
|
}`}
|
||||||
>
|
>
|
||||||
{item.props.icon}
|
{item.props.icon}
|
||||||
@@ -127,7 +127,7 @@ export const DualSidebar: React.FC<DualSidebarProps> = ({ children }) => {
|
|||||||
<TooltipContent
|
<TooltipContent
|
||||||
side="right"
|
side="right"
|
||||||
sideOffset={16}
|
sideOffset={16}
|
||||||
className="bg-slate-800 text-white border-slate-700"
|
className="bg-popover text-popover-foreground border border-border"
|
||||||
>
|
>
|
||||||
<p>{item.props.label}</p>
|
<p>{item.props.label}</p>
|
||||||
</TooltipContent>
|
</TooltipContent>
|
||||||
@@ -142,16 +142,16 @@ export const DualSidebar: React.FC<DualSidebarProps> = ({ children }) => {
|
|||||||
|
|
||||||
{/* Level 2: Content Panel */}
|
{/* Level 2: Content Panel */}
|
||||||
<div
|
<div
|
||||||
className={`transition-all duration-300 ease-in-out bg-white dark:bg-slate-900/95 backdrop-blur-sm shadow-lg overflow-hidden ${
|
className={`transition-all duration-300 ease-in-out bg-sidebar/95 backdrop-blur-sm shadow-lg overflow-hidden ${
|
||||||
activeItem !== null
|
activeItem !== null
|
||||||
? 'w-[calc(100vw-4rem)] md:w-100 border-r border-slate-200 dark:border-slate-800'
|
? 'w-[calc(100vw-4rem)] md:w-100 border-r border-sidebar-border'
|
||||||
: 'w-0'
|
: 'w-0'
|
||||||
}`}
|
}`}
|
||||||
>
|
>
|
||||||
<div className="w-[calc(100vw-4rem)] md:w-100 h-full flex flex-col">
|
<div className="w-[calc(100vw-4rem)] md:w-100 h-full flex flex-col">
|
||||||
{activeItemContent && (
|
{activeItemContent && (
|
||||||
<>
|
<>
|
||||||
<header className="h-16 flex items-center px-4 font-bold text-lg border-b border-slate-200 dark:border-slate-800 flex-shrink-0">
|
<header className="h-16 flex items-center px-4 font-bold text-lg border-b border-sidebar-border flex-shrink-0">
|
||||||
<h2>{activeItemContent.label}</h2>
|
<h2>{activeItemContent.label}</h2>
|
||||||
</header>
|
</header>
|
||||||
<div className="flex-1 overflow-y-auto p-2">{activeItemContent.children}</div>
|
<div className="flex-1 overflow-y-auto p-2">{activeItemContent.children}</div>
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
import { type FieldInfo as MetadataFieldInfo, type FieldInfo, FieldType } from '@/dtos/metadata'
|
import { FieldType, type FieldInfo, type FieldInfo as MetadataFieldInfo } from '@/dtos/metadata'
|
||||||
import { client } from '@/ui/api/client'
|
import { client } from '@/ui/api/client'
|
||||||
import { useMutation } from '@tanstack/react-query'
|
|
||||||
import { InferRequestType, InferResponseType } from 'hono/client'
|
|
||||||
import { useFieldStore } from '@/ui/stores/fields'
|
import { useFieldStore } from '@/ui/stores/fields'
|
||||||
import { DragDropProvider, KeyboardSensor, PointerSensor, type DragEndEvent } from '@dnd-kit/react'
|
import { DragDropProvider, KeyboardSensor, PointerSensor, type DragEndEvent } from '@dnd-kit/react'
|
||||||
import { useSortable } from '@dnd-kit/react/sortable'
|
import { useSortable } from '@dnd-kit/react/sortable'
|
||||||
|
import { useMutation } from '@tanstack/react-query'
|
||||||
|
import { InferRequestType, InferResponseType } from 'hono/client'
|
||||||
|
|
||||||
import { Button } from '@/ui/components/ui/button'
|
import { Button } from '@/ui/components/ui/button'
|
||||||
import {
|
import {
|
||||||
|
|||||||
@@ -3,31 +3,23 @@ import { client } from '@/ui/api/client'
|
|||||||
import type { InferRequestType, InferResponseType } from 'hono/client'
|
import type { InferRequestType, InferResponseType } from 'hono/client'
|
||||||
|
|
||||||
import type { AssetInfo } from '@/dtos/asset'
|
import type { AssetInfo } from '@/dtos/asset'
|
||||||
import type { SearchCondition, SearchSort } from '@/dtos/search'
|
|
||||||
import type { CreateUploadTaskRequest } from '@/dtos/upload'
|
|
||||||
import type { ShareLinkInfo } from '@/dtos/share'
|
|
||||||
import type { CollectionInfo } from '@/dtos/collection'
|
import type { CollectionInfo } from '@/dtos/collection'
|
||||||
|
import type { SearchCondition, SearchSort } from '@/dtos/search'
|
||||||
|
import type { ShareLinkInfo } from '@/dtos/share'
|
||||||
|
import type { CreateUploadTaskRequest } from '@/dtos/upload'
|
||||||
|
import { formatSize } from '@/ui/lib/format'
|
||||||
import { useFieldStore } from '@/ui/stores/fields'
|
import { useFieldStore } from '@/ui/stores/fields'
|
||||||
import { useUploadStore } from '@/ui/stores/upload'
|
import { useUploadStore } from '@/ui/stores/upload'
|
||||||
import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query'
|
import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query'
|
||||||
|
import { useNavigate } from '@tanstack/react-router'
|
||||||
import { Download } from 'lucide-react'
|
import { Download } from 'lucide-react'
|
||||||
import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react'
|
import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react'
|
||||||
import { useInView } from 'react-intersection-observer'
|
import { useInView } from 'react-intersection-observer'
|
||||||
import { toast } from 'sonner'
|
import { toast } from 'sonner'
|
||||||
import { formatSize } from '@/ui/lib/format'
|
|
||||||
import type { DragState } from '../dnd-types'
|
import type { DragState } from '../dnd-types'
|
||||||
import { FileBrowserContextMenu } from './context-menu'
|
|
||||||
import { useNavigate } from '@tanstack/react-router'
|
|
||||||
import { MoveCopyDialog } from '../move-copy-dialog'
|
import { MoveCopyDialog } from '../move-copy-dialog'
|
||||||
|
import { FileBrowserContextMenu } from './context-menu'
|
||||||
|
|
||||||
import { FileBrowserGridView } from './grid-view'
|
|
||||||
import { FileBrowserListView } from './list-view'
|
|
||||||
import { FileBrowserToolbar } from './toolbar'
|
|
||||||
import { FileCard } from './file-card'
|
|
||||||
import { FileListItem } from './file-list-item'
|
|
||||||
import { FolderCard } from './folder-card'
|
|
||||||
import { Button } from '../ui/button'
|
|
||||||
import { ContextMenu, ContextMenuTrigger } from '../ui/context-menu'
|
|
||||||
import {
|
import {
|
||||||
AlertDialog,
|
AlertDialog,
|
||||||
AlertDialogAction,
|
AlertDialogAction,
|
||||||
@@ -38,6 +30,14 @@ import {
|
|||||||
AlertDialogHeader,
|
AlertDialogHeader,
|
||||||
AlertDialogTitle,
|
AlertDialogTitle,
|
||||||
} from '../ui/alert-dialog'
|
} from '../ui/alert-dialog'
|
||||||
|
import { Button } from '../ui/button'
|
||||||
|
import { ContextMenu, ContextMenuTrigger } from '../ui/context-menu'
|
||||||
|
import { FileCard } from './file-card'
|
||||||
|
import { FileListItem } from './file-list-item'
|
||||||
|
import { FolderCard } from './folder-card'
|
||||||
|
import { FileBrowserGridView } from './grid-view'
|
||||||
|
import { FileBrowserListView } from './list-view'
|
||||||
|
import { FileBrowserToolbar } from './toolbar'
|
||||||
import { useFileActions } from './use-file-actions'
|
import { useFileActions } from './use-file-actions'
|
||||||
|
|
||||||
interface FileBrowserProps {
|
interface FileBrowserProps {
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import type { AssetInfo, ChildPreview } from '@/dtos/asset'
|
import type { AssetInfo, ChildPreview } from '@/dtos/asset'
|
||||||
|
import { Checkbox } from '@/ui/components/ui/checkbox'
|
||||||
import {
|
import {
|
||||||
DropdownMenu,
|
DropdownMenu,
|
||||||
DropdownMenuContent,
|
DropdownMenuContent,
|
||||||
@@ -6,14 +7,13 @@ import {
|
|||||||
DropdownMenuSeparator,
|
DropdownMenuSeparator,
|
||||||
DropdownMenuTrigger,
|
DropdownMenuTrigger,
|
||||||
} from '@/ui/components/ui/dropdown-menu'
|
} from '@/ui/components/ui/dropdown-menu'
|
||||||
|
import { EditableText } from '@/ui/components/ui/editable-text'
|
||||||
import { cn } from '@/ui/lib/utils'
|
import { cn } from '@/ui/lib/utils'
|
||||||
import { useDraggable, useDroppable } from '@dnd-kit/react'
|
import { useDraggable, useDroppable } from '@dnd-kit/react'
|
||||||
import { Download, Edit, History, MoreHorizontal, Trash2 } from 'lucide-react'
|
import { Download, Edit, History, MoreHorizontal, Trash2 } from 'lucide-react'
|
||||||
import React, { useEffect, useMemo, useRef, useState } from 'react'
|
import React, { useEffect, useMemo, useRef, useState } from 'react'
|
||||||
import type { DragState } from '../dnd-types'
|
import type { DragState } from '../dnd-types'
|
||||||
import { FilePreview } from './file-preview'
|
import { FilePreview } from './file-preview'
|
||||||
import { Checkbox } from '@/ui/components/ui/checkbox'
|
|
||||||
import { EditableText } from '@/ui/components/ui/editable-text'
|
|
||||||
|
|
||||||
interface FolderCardProps {
|
interface FolderCardProps {
|
||||||
item: AssetInfo
|
item: AssetInfo
|
||||||
@@ -51,21 +51,17 @@ const FolderPreviewGrid = ({ items }: { items: ChildPreview[] }) => {
|
|||||||
|
|
||||||
// 1 Item
|
// 1 Item
|
||||||
if (count === 1) {
|
if (count === 1) {
|
||||||
return (
|
return <div className="w-full h-full bg-muted/50 rounded-sm">{renderItem(safeChildren[0])}</div>
|
||||||
<div className="w-full h-full bg-zinc-200 dark:bg-zinc-800/50 rounded-sm">
|
|
||||||
{renderItem(safeChildren[0])}
|
|
||||||
</div>
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 2 Items
|
// 2 Items
|
||||||
if (count === 2) {
|
if (count === 2) {
|
||||||
return (
|
return (
|
||||||
<div className="grid grid-cols-2 gap-0.5 h-full w-full">
|
<div className="grid grid-cols-2 gap-0.5 h-full w-full">
|
||||||
<div className="overflow-hidden h-full bg-zinc-200 dark:bg-zinc-800/50 rounded-sm">
|
<div className="overflow-hidden h-full bg-muted/50 rounded-sm">
|
||||||
{renderItem(safeChildren[0])}
|
{renderItem(safeChildren[0])}
|
||||||
</div>
|
</div>
|
||||||
<div className="overflow-hidden h-full bg-zinc-200 dark:bg-zinc-800/50 rounded-sm">
|
<div className="overflow-hidden h-full bg-muted/50 rounded-sm">
|
||||||
{renderItem(safeChildren[1])}
|
{renderItem(safeChildren[1])}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -75,14 +71,14 @@ const FolderPreviewGrid = ({ items }: { items: ChildPreview[] }) => {
|
|||||||
// 3 Items
|
// 3 Items
|
||||||
return (
|
return (
|
||||||
<div className="grid grid-cols-3 gap-0.5 h-full w-full">
|
<div className="grid grid-cols-3 gap-0.5 h-full w-full">
|
||||||
<div className="col-span-1 overflow-hidden h-full relative bg-zinc-200 dark:bg-zinc-800/50 rounded-sm col-span-2">
|
<div className="col-span-1 overflow-hidden h-full relative bg-muted/50 rounded-sm col-span-2">
|
||||||
<div className="absolute inset-0 w-full h-full">{renderItem(safeChildren[0])}</div>
|
<div className="absolute inset-0 w-full h-full">{renderItem(safeChildren[0])}</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="col-span-1 grid grid-rows-2 gap-0.5 h-full col-span-1">
|
<div className="col-span-1 grid grid-rows-2 gap-0.5 h-full col-span-1">
|
||||||
<div className="overflow-hidden h-full relative bg-zinc-200 dark:bg-zinc-800/50 rounded-sm">
|
<div className="overflow-hidden h-full relative bg-muted/50 rounded-sm">
|
||||||
<div className="absolute inset-0 w-full h-full">{renderItem(safeChildren[1])}</div>
|
<div className="absolute inset-0 w-full h-full">{renderItem(safeChildren[1])}</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="overflow-hidden h-full relative bg-zinc-200 dark:bg-zinc-800/50 rounded-sm">
|
<div className="overflow-hidden h-full relative bg-muted/50 rounded-sm">
|
||||||
<div className="absolute inset-0 w-full h-full">{renderItem(safeChildren[2])}</div>
|
<div className="absolute inset-0 w-full h-full">{renderItem(safeChildren[2])}</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -195,8 +191,8 @@ export function FolderCard({
|
|||||||
const tabHeight = 8
|
const tabHeight = 8
|
||||||
const config = {
|
const config = {
|
||||||
cornerRadius: 4,
|
cornerRadius: 4,
|
||||||
tabRadius: 3,
|
tabRadius: 0,
|
||||||
tabSlope: 10,
|
tabSlope: 15,
|
||||||
tabBaseWidth: 150,
|
tabBaseWidth: 150,
|
||||||
}
|
}
|
||||||
const folderPath = useMemo(() => {
|
const folderPath = useMemo(() => {
|
||||||
@@ -223,6 +219,27 @@ export function FolderCard({
|
|||||||
'group relative w-full max-w-[340px] select-none cursor-pointer isolate flex flex-col items-center h-full',
|
'group relative w-full max-w-[340px] select-none cursor-pointer isolate flex flex-col items-center h-full',
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
|
<div className="absolute inset-0 z-10 pointer-events-none">
|
||||||
|
<svg
|
||||||
|
width="100%"
|
||||||
|
height="100%"
|
||||||
|
viewBox={`0 0 ${width} ${height}`}
|
||||||
|
preserveAspectRatio="none"
|
||||||
|
className="overflow-visible"
|
||||||
|
>
|
||||||
|
<path
|
||||||
|
d={folderPath}
|
||||||
|
vectorEffect="non-scaling-stroke"
|
||||||
|
strokeLinejoin="round"
|
||||||
|
strokeWidth={showDropFeedback ? 3 : 1}
|
||||||
|
className={cn(
|
||||||
|
'transition-colors duration-200 fill-none group-hover:stroke-primary',
|
||||||
|
(isSelected || isChecked || showDropFeedback) && 'stroke-primary',
|
||||||
|
)}
|
||||||
|
/>
|
||||||
|
</svg>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div className="absolute inset-0 -z-10 drop-shadow-sm pointer-events-none">
|
<div className="absolute inset-0 -z-10 drop-shadow-sm pointer-events-none">
|
||||||
<svg
|
<svg
|
||||||
width="100%"
|
width="100%"
|
||||||
@@ -235,23 +252,19 @@ export function FolderCard({
|
|||||||
d={folderPath}
|
d={folderPath}
|
||||||
vectorEffect="non-scaling-stroke"
|
vectorEffect="non-scaling-stroke"
|
||||||
strokeLinejoin="round"
|
strokeLinejoin="round"
|
||||||
strokeWidth={showDropFeedback ? 3 : 2}
|
strokeWidth={showDropFeedback ? 3 : 1}
|
||||||
className={cn(
|
className={cn('transition-colors duration-200 fill-foreground/15')}
|
||||||
'transition-colors duration-200 fill-foreground/10 dark:fill-slate-800 dark:stroke-slate-600 group-hover:stroke-indigo-400 dark:group-hover:stroke-indigo-400',
|
|
||||||
(isSelected || isChecked || showDropFeedback) &&
|
|
||||||
'stroke-indigo-500 dark:stroke-indigo-400',
|
|
||||||
)}
|
|
||||||
/>
|
/>
|
||||||
</svg>
|
</svg>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="relative w-[calc(100%-0.2rem)] mb-[0.1rem] flex flex-1 flex-col p-2 mt-4 bg-secondary rounded-sm">
|
<div className="relative w-full flex flex-1 flex-col p-2 mt-5 bg-muted dark:bg-card rounded-sm">
|
||||||
<div className="relative w-full aspect-video shrink-0 overflow-hidden">
|
<div className="relative w-full aspect-video shrink-0 overflow-hidden">
|
||||||
<div className="absolute top-1 left-1 z-30 transition-all duration-200">
|
<div className="absolute top-1 left-1 z-30 transition-all duration-200">
|
||||||
<Checkbox
|
<Checkbox
|
||||||
checked={isChecked}
|
checked={isChecked}
|
||||||
onClick={(e) => e.stopPropagation()} // Let parent handler deal with it
|
onClick={(e) => e.stopPropagation()} // Let parent handler deal with it
|
||||||
className="w-5 h-5 border-1 border-black/30 bg-black/5 data-[state=checked]:bg-indigo-600 data-[state=checked]:border-indigo-600"
|
className="w-5 h-5 border-1 border-foreground/20 bg-background/50 data-[state=checked]:bg-primary data-[state=checked]:border-primary"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -268,11 +281,11 @@ export function FolderCard({
|
|||||||
onBlur={handleRename}
|
onBlur={handleRename}
|
||||||
onKeyDown={handleKeyDown}
|
onKeyDown={handleKeyDown}
|
||||||
disabled={!isEditing}
|
disabled={!isEditing}
|
||||||
className="font-semibold text-slate-800 dark:text-slate-100 text-lg leading-tight truncate h-auto p-0"
|
className="font-semibold text-foreground text-lg leading-tight truncate h-auto p-0 !bg-transparent"
|
||||||
title={name}
|
title={name}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<div className="flex items-center justify-between text-slate-500 dark:text-slate-400">
|
<div className="flex items-center justify-between text-muted-foreground">
|
||||||
<span className="text-xs tracking-wide opacity-80">
|
<span className="text-xs tracking-wide opacity-80">
|
||||||
{item.fileCount || 0} {(item.fileCount || 0) === 1 ? 'Item' : 'Items'}
|
{item.fileCount || 0} {(item.fileCount || 0) === 1 ? 'Item' : 'Items'}
|
||||||
</span>
|
</span>
|
||||||
@@ -280,7 +293,7 @@ export function FolderCard({
|
|||||||
<DropdownMenuTrigger asChild>
|
<DropdownMenuTrigger asChild>
|
||||||
<button
|
<button
|
||||||
onClick={(e) => e.stopPropagation()}
|
onClick={(e) => e.stopPropagation()}
|
||||||
className="p-1.5 -mr-2 rounded-full hover:bg-slate-200/50 dark:hover:bg-slate-700/50 text-slate-400 hover:text-slate-600 dark:hover:text-slate-300 transition-colors cursor-pointer"
|
className="p-1.5 -mr-2 rounded-full hover:bg-muted text-muted-foreground hover:text-foreground transition-colors cursor-pointer"
|
||||||
>
|
>
|
||||||
<MoreHorizontal size={18} />
|
<MoreHorizontal size={18} />
|
||||||
</button>
|
</button>
|
||||||
|
|||||||
@@ -1,28 +1,28 @@
|
|||||||
import type { AssetInfo, AssetInfoPaginatedList } from '@/dtos/asset'
|
import type { AssetInfo, AssetInfoPaginatedList } from '@/dtos/asset'
|
||||||
|
import type { CollectionInfo } from '@/dtos/collection'
|
||||||
import { type FieldInfo as MetadataFieldInfo } from '@/dtos/metadata'
|
import { type FieldInfo as MetadataFieldInfo } from '@/dtos/metadata'
|
||||||
import type { SearchCondition, SearchSort } from '@/dtos/search'
|
import type { SearchCondition, SearchSort } from '@/dtos/search'
|
||||||
import type { CollectionInfo } from '@/dtos/collection'
|
|
||||||
import { client } from '@/ui/api/client'
|
import { client } from '@/ui/api/client'
|
||||||
import { useMutation } from '@tanstack/react-query'
|
import { useMutation } from '@tanstack/react-query'
|
||||||
import { InferRequestType, InferResponseType } from 'hono/client'
|
import { InferRequestType, InferResponseType } from 'hono/client'
|
||||||
|
|
||||||
import { useFieldStore } from '@/ui/stores/fields'
|
import { useFieldStore } from '@/ui/stores/fields'
|
||||||
import { useMemberStore } from '@/ui/stores/members'
|
import { useMemberStore } from '@/ui/stores/members'
|
||||||
|
import { useTopNavStore } from '@/ui/stores/top-nav'
|
||||||
import { useUiStore } from '@/ui/stores/ui'
|
import { useUiStore } from '@/ui/stores/ui'
|
||||||
import { useUserMetadataStore } from '@/ui/stores/user-metadata'
|
import { useUserMetadataStore } from '@/ui/stores/user-metadata'
|
||||||
import { useTopNavStore } from '@/ui/stores/top-nav'
|
import { PointerActivationConstraints } from '@dnd-kit/dom'
|
||||||
|
import { DragDropProvider, DragOverlay, KeyboardSensor, PointerSensor } from '@dnd-kit/react'
|
||||||
import { useInfiniteQuery, useQuery, useQueryClient } from '@tanstack/react-query'
|
import { useInfiniteQuery, useQuery, useQueryClient } from '@tanstack/react-query'
|
||||||
import { useNavigate } from '@tanstack/react-router'
|
import { useNavigate } from '@tanstack/react-router'
|
||||||
import { useEffect, useMemo, useRef, useState } from 'react'
|
import { useEffect, useMemo, useRef, useState } from 'react'
|
||||||
|
import { cn } from '../lib/utils'
|
||||||
|
import { SnapToPointer } from './dnd-modifiers'
|
||||||
import { FileBrowser } from './file-browser/file-browser'
|
import { FileBrowser } from './file-browser/file-browser'
|
||||||
import { FileViewerRightSidebar } from './file-viewer-right-sidebar'
|
import { FileViewerRightSidebar } from './file-viewer-right-sidebar'
|
||||||
import { FolderTree } from './folder-tree'
|
import { FolderTree } from './folder-tree'
|
||||||
import { ResizeHandle } from './resize-handle'
|
import { ResizeHandle } from './resize-handle'
|
||||||
import { useFileSystemDnd } from './use-file-system-dnd'
|
import { useFileSystemDnd } from './use-file-system-dnd'
|
||||||
import { PointerActivationConstraints } from '@dnd-kit/dom'
|
|
||||||
import { DragDropProvider, DragOverlay, KeyboardSensor, PointerSensor } from '@dnd-kit/react'
|
|
||||||
import { SnapToPointer } from './dnd-modifiers'
|
|
||||||
import { cn } from '../lib/utils'
|
|
||||||
|
|
||||||
type FileSystemManagerProps = {
|
type FileSystemManagerProps = {
|
||||||
teamId: string
|
teamId: string
|
||||||
|
|||||||
@@ -85,21 +85,19 @@ export const NotificationCard = ({ notification }: NotificationCardProps) => {
|
|||||||
<div
|
<div
|
||||||
className={cn(
|
className={cn(
|
||||||
'w-1.5 h-1.5 rounded-full shadow-xs',
|
'w-1.5 h-1.5 rounded-full shadow-xs',
|
||||||
isRead ? 'bg-transparent' : 'bg-red-500',
|
isRead ? 'bg-transparent' : 'bg-destructive',
|
||||||
)}
|
)}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<div className="flex-1 min-w-0 flex flex-col justify-center pl-2">
|
<div className="flex-1 min-w-0 flex flex-col justify-center pl-2">
|
||||||
<div className="text-sm text-slate-800 dark:text-slate-200 break-all leading-snug">
|
<div className="text-sm text-foreground break-all leading-snug">{message}</div>
|
||||||
{message}
|
<div className="text-[11px] text-muted-foreground mt-1">
|
||||||
</div>
|
|
||||||
<div className="text-[11px] text-slate-500 dark:text-slate-400 mt-1">
|
|
||||||
{formatTimeAgo(createdAt || '')}
|
{formatTimeAgo(createdAt || '')}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{hasPreview && (
|
{hasPreview && (
|
||||||
<div className="w-18 h-18 ml-2 rounded-md overflow-hidden flex-shrink-0 bg-slate-100 dark:bg-slate-800 border border-slate-200 dark:border-slate-700 flex items-center justify-center mt-0.5">
|
<div className="w-18 h-18 ml-2 rounded-md overflow-hidden flex-shrink-0 bg-muted border border-border flex items-center justify-center mt-0.5">
|
||||||
<img src={asset!.preview} alt={asset!.name} className="w-full h-full object-cover" />
|
<img src={asset!.preview} alt={asset!.name} className="w-full h-full object-cover" />
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|||||||
@@ -116,7 +116,7 @@ export const NotificationList = () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="flex flex-col h-full w-full bg-white dark:bg-slate-900">
|
<div className="flex flex-col h-full w-full bg-transparent">
|
||||||
<div className="flex-none pb-1">
|
<div className="flex-none pb-1">
|
||||||
<Tabs
|
<Tabs
|
||||||
value={activeTab}
|
value={activeTab}
|
||||||
@@ -136,7 +136,7 @@ export const NotificationList = () => {
|
|||||||
<Button
|
<Button
|
||||||
variant="ghost"
|
variant="ghost"
|
||||||
size="sm"
|
size="sm"
|
||||||
className="h-8 px-2 text-slate-500 hover:text-slate-900 dark:text-slate-400 dark:hover:text-slate-100"
|
className="h-8 px-2 text-muted-foreground hover:text-foreground"
|
||||||
onClick={handleMarkAllRead}
|
onClick={handleMarkAllRead}
|
||||||
disabled={notifications.length === 0 || markReadMutation.isPending}
|
disabled={notifications.length === 0 || markReadMutation.isPending}
|
||||||
title="Mark all as read"
|
title="Mark all as read"
|
||||||
@@ -150,12 +150,12 @@ export const NotificationList = () => {
|
|||||||
<div className="flex-1 overflow-y-auto p-2 min-h-0">
|
<div className="flex-1 overflow-y-auto p-2 min-h-0">
|
||||||
{isLoading && (
|
{isLoading && (
|
||||||
<div className="flex justify-center p-4">
|
<div className="flex justify-center p-4">
|
||||||
<Loader2 className="w-6 h-6 animate-spin text-slate-400" />
|
<Loader2 className="w-6 h-6 animate-spin text-muted-foreground" />
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{!isLoading && notifications.length === 0 && (
|
{!isLoading && notifications.length === 0 && (
|
||||||
<div className="flex flex-col items-center justify-center h-40 text-slate-500 dark:text-slate-400">
|
<div className="flex flex-col items-center justify-center h-40 text-muted-foreground">
|
||||||
<p className="text-sm">No notifications</p>
|
<p className="text-sm">No notifications</p>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
@@ -168,7 +168,7 @@ export const NotificationList = () => {
|
|||||||
|
|
||||||
{/* Infinite Scroll Trigger */}
|
{/* Infinite Scroll Trigger */}
|
||||||
<div ref={ref} className="h-4 w-full flex justify-center p-1">
|
<div ref={ref} className="h-4 w-full flex justify-center p-1">
|
||||||
{isFetchingNextPage && <Loader2 className="w-4 h-4 animate-spin text-slate-400" />}
|
{isFetchingNextPage && <Loader2 className="w-4 h-4 animate-spin text-muted-foreground" />}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -171,7 +171,7 @@ export function AgentsSettings({ teamId }: AgentsSettingsProps) {
|
|||||||
<AlertDialogFooter>
|
<AlertDialogFooter>
|
||||||
<AlertDialogCancel>Cancel</AlertDialogCancel>
|
<AlertDialogCancel>Cancel</AlertDialogCancel>
|
||||||
<AlertDialogAction
|
<AlertDialogAction
|
||||||
className="bg-red-600 hover:bg-red-700"
|
className="bg-destructive hover:bg-destructive/90 text-white"
|
||||||
onClick={(e) => {
|
onClick={(e) => {
|
||||||
if (deleteAgentMutation.isPending) {
|
if (deleteAgentMutation.isPending) {
|
||||||
e.preventDefault()
|
e.preventDefault()
|
||||||
@@ -194,13 +194,13 @@ export function AgentsSettings({ teamId }: AgentsSettingsProps) {
|
|||||||
|
|
||||||
{isLoading && agents.length === 0 ? (
|
{isLoading && agents.length === 0 ? (
|
||||||
<div className="flex items-center justify-center p-12">
|
<div className="flex items-center justify-center p-12">
|
||||||
<Loader2 className="w-8 h-8 animate-spin text-slate-400" />
|
<Loader2 className="w-8 h-8 animate-spin text-muted-foreground" />
|
||||||
</div>
|
</div>
|
||||||
) : (
|
) : (
|
||||||
<div className="space-y-6 max-w-5xl mx-auto relative">
|
<div className="space-y-6 max-w-5xl mx-auto relative">
|
||||||
{isLoading && (
|
{isLoading && (
|
||||||
<div className="absolute top-0 right-0 p-2">
|
<div className="absolute top-0 right-0 p-2">
|
||||||
<Loader2 className="w-4 h-4 animate-spin text-slate-400" />
|
<Loader2 className="w-4 h-4 animate-spin text-muted-foreground" />
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
{AGENT_TYPES.map((section) => {
|
{AGENT_TYPES.map((section) => {
|
||||||
@@ -210,16 +210,14 @@ export function AgentsSettings({ teamId }: AgentsSettingsProps) {
|
|||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
key={section.type}
|
key={section.type}
|
||||||
className="bg-white dark:bg-slate-900/50 rounded-xl border border-slate-200 dark:border-slate-800 overflow-hidden"
|
className="bg-card rounded-xl border border-border overflow-hidden"
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
className="px-6 py-4 flex items-center justify-between cursor-pointer hover:bg-slate-50 dark:hover:bg-slate-800/50 transition-colors"
|
className="px-6 py-4 flex items-center justify-between cursor-pointer hover:bg-muted/50 transition-colors"
|
||||||
onClick={() => toggleSection(section.type)}
|
onClick={() => toggleSection(section.type)}
|
||||||
>
|
>
|
||||||
<div className="flex items-center gap-2">
|
<div className="flex items-center gap-2">
|
||||||
<h3 className="font-semibold text-slate-900 dark:text-white">
|
<h3 className="font-semibold text-foreground">{section.label} Agents</h3>
|
||||||
{section.label} Agents
|
|
||||||
</h3>
|
|
||||||
<Badge variant="secondary" className="h-5 px-1.5 min-w-[1.25rem] text-[10px]">
|
<Badge variant="secondary" className="h-5 px-1.5 min-w-[1.25rem] text-[10px]">
|
||||||
{typeAgents.length}
|
{typeAgents.length}
|
||||||
</Badge>
|
</Badge>
|
||||||
@@ -232,7 +230,7 @@ export function AgentsSettings({ teamId }: AgentsSettingsProps) {
|
|||||||
<Button
|
<Button
|
||||||
variant="ghost"
|
variant="ghost"
|
||||||
size="icon"
|
size="icon"
|
||||||
className="h-8 w-8 rounded-full bg-blue-50 dark:bg-blue-900/20 text-blue-600 dark:text-blue-400 hover:bg-blue-100 dark:hover:bg-blue-900/40"
|
className="h-8 w-8 rounded-full bg-primary/10 text-primary hover:bg-primary/20"
|
||||||
onClick={(e) => {
|
onClick={(e) => {
|
||||||
e.stopPropagation()
|
e.stopPropagation()
|
||||||
setCreateType(section.type)
|
setCreateType(section.type)
|
||||||
@@ -244,7 +242,7 @@ export function AgentsSettings({ teamId }: AgentsSettingsProps) {
|
|||||||
)}
|
)}
|
||||||
<ChevronDown
|
<ChevronDown
|
||||||
className={cn(
|
className={cn(
|
||||||
'w-5 h-5 text-slate-400 transition-transform duration-200',
|
'w-5 h-5 text-muted-foreground transition-transform duration-200',
|
||||||
expandedSections[section.type] ? 'rotate-180' : '',
|
expandedSections[section.type] ? 'rotate-180' : '',
|
||||||
)}
|
)}
|
||||||
/>
|
/>
|
||||||
@@ -257,12 +255,12 @@ export function AgentsSettings({ teamId }: AgentsSettingsProps) {
|
|||||||
{typeAgents.map((agent) => (
|
{typeAgents.map((agent) => (
|
||||||
<Card
|
<Card
|
||||||
key={agent.id}
|
key={agent.id}
|
||||||
className="group relative overflow-hidden border-slate-200 dark:border-slate-800 hover:border-blue-500/50 dark:hover:border-blue-400/50 transition-all duration-200 cursor-pointer"
|
className="group relative overflow-hidden border-border hover:border-primary/50 transition-all duration-200 cursor-pointer"
|
||||||
onClick={() => setAgentToEdit(agent)}
|
onClick={() => setAgentToEdit(agent)}
|
||||||
>
|
>
|
||||||
<CardContent className="p-4 flex items-center justify-between">
|
<CardContent className="p-4 flex items-center justify-between">
|
||||||
<div className="flex items-center gap-3 min-w-0 flex-1">
|
<div className="flex items-center gap-3 min-w-0 flex-1">
|
||||||
<div className="w-10 h-10 rounded-full bg-slate-100 dark:bg-slate-800 flex items-center justify-center overflow-hidden">
|
<div className="w-10 h-10 rounded-full bg-muted flex items-center justify-center overflow-hidden">
|
||||||
{agent.avatar ? (
|
{agent.avatar ? (
|
||||||
<img
|
<img
|
||||||
src={agent.avatar}
|
src={agent.avatar}
|
||||||
@@ -270,14 +268,14 @@ export function AgentsSettings({ teamId }: AgentsSettingsProps) {
|
|||||||
alt=""
|
alt=""
|
||||||
/>
|
/>
|
||||||
) : (
|
) : (
|
||||||
<Bot className="w-6 h-6 text-slate-400" />
|
<Bot className="w-6 h-6 text-muted-foreground" />
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
<div className="min-w-0 flex-1">
|
<div className="min-w-0 flex-1">
|
||||||
<span className="font-bold text-slate-900 dark:text-white block truncate">
|
<span className="font-bold text-foreground block truncate">
|
||||||
{agent.name}
|
{agent.name}
|
||||||
</span>
|
</span>
|
||||||
<div className="flex items-center gap-2 text-xs text-slate-500 mt-0.5">
|
<div className="flex items-center gap-2 text-xs text-muted-foreground mt-0.5">
|
||||||
<span className="flex items-center gap-1">
|
<span className="flex items-center gap-1">
|
||||||
<Puzzle className="w-3 h-3" />
|
<Puzzle className="w-3 h-3" />
|
||||||
{agent.skills?.length || 0} Skills
|
{agent.skills?.length || 0} Skills
|
||||||
@@ -312,7 +310,7 @@ export function AgentsSettings({ teamId }: AgentsSettingsProps) {
|
|||||||
<Button
|
<Button
|
||||||
variant="ghost"
|
variant="ghost"
|
||||||
size="icon"
|
size="icon"
|
||||||
className="h-8 w-8 text-slate-400 hover:text-slate-600 dark:hover:text-slate-300"
|
className="h-8 w-8 text-muted-foreground hover:text-foreground"
|
||||||
>
|
>
|
||||||
<MoreVertical className="w-4 h-4" />
|
<MoreVertical className="w-4 h-4" />
|
||||||
</Button>
|
</Button>
|
||||||
@@ -335,15 +333,17 @@ export function AgentsSettings({ teamId }: AgentsSettingsProps) {
|
|||||||
</Card>
|
</Card>
|
||||||
))}
|
))}
|
||||||
{typeAgents.length === 0 && (
|
{typeAgents.length === 0 && (
|
||||||
<div className="col-span-full py-8 flex flex-col items-center justify-center border-2 border-dashed border-slate-200 dark:border-slate-800 rounded-xl bg-slate-50/50 dark:bg-slate-900/20">
|
<div className="col-span-full py-8 flex flex-col items-center justify-center border-2 border-dashed border-border rounded-xl bg-muted/30">
|
||||||
<div className="w-10 h-10 rounded-full bg-white dark:bg-slate-800 flex items-center justify-center shadow-sm mb-3">
|
<div className="w-10 h-10 rounded-full bg-card flex items-center justify-center shadow-sm mb-3">
|
||||||
<Icon className="w-5 h-5 text-slate-400" />
|
<Icon className="w-5 h-5 text-muted-foreground" />
|
||||||
</div>
|
</div>
|
||||||
<p className="text-sm text-slate-500">No {section.label} agents found</p>
|
<p className="text-sm text-muted-foreground">
|
||||||
|
No {section.label} agents found
|
||||||
|
</p>
|
||||||
<Button
|
<Button
|
||||||
variant="link"
|
variant="link"
|
||||||
size="sm"
|
size="sm"
|
||||||
className="text-blue-600 font-medium h-auto p-0 mt-1"
|
className="text-primary font-medium h-auto p-0 mt-1"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
setCreateType(section.type)
|
setCreateType(section.type)
|
||||||
setIsCreateDialogOpen(true)
|
setIsCreateDialogOpen(true)
|
||||||
|
|||||||
@@ -194,7 +194,7 @@ export function ProvidersSettings({ teamId }: ProvidersSettingsProps) {
|
|||||||
if (isLoading) {
|
if (isLoading) {
|
||||||
return (
|
return (
|
||||||
<div className="flex h-64 items-center justify-center">
|
<div className="flex h-64 items-center justify-center">
|
||||||
<Loader2 className="h-8 w-8 animate-spin text-blue-600" />
|
<Loader2 className="h-8 w-8 animate-spin text-primary" />
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -203,13 +203,13 @@ export function ProvidersSettings({ teamId }: ProvidersSettingsProps) {
|
|||||||
<div className="h-full flex flex-col space-y-0">
|
<div className="h-full flex flex-col space-y-0">
|
||||||
<div className="flex-none space-y-4 pb-4">
|
<div className="flex-none space-y-4 pb-4">
|
||||||
<div className="flex items-center justify-between">
|
<div className="flex items-center justify-between">
|
||||||
<h3 className="text-lg font-semibold text-slate-900 dark:text-white flex items-center gap-2">
|
<h3 className="text-lg font-semibold text-foreground flex items-center gap-2">
|
||||||
<Cpu className="w-5 h-5 text-blue-600" />
|
<Cpu className="w-5 h-5 text-primary" />
|
||||||
Configured AI Providers
|
Configured AI Providers
|
||||||
</h3>
|
</h3>
|
||||||
<Button
|
<Button
|
||||||
onClick={() => setIsCreateDialogOpen(true)}
|
onClick={() => setIsCreateDialogOpen(true)}
|
||||||
className="bg-blue-600 hover:bg-blue-700 text-white gap-2"
|
className="bg-primary hover:bg-primary/90 text-primary-foreground gap-2"
|
||||||
>
|
>
|
||||||
<Plus className="w-4 h-4" />
|
<Plus className="w-4 h-4" />
|
||||||
Add Provider
|
Add Provider
|
||||||
@@ -217,12 +217,12 @@ export function ProvidersSettings({ teamId }: ProvidersSettingsProps) {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="relative px-0.5">
|
<div className="relative px-0.5">
|
||||||
<Search className="absolute left-3.5 top-1/2 -translate-y-1/2 w-4 h-4 text-slate-400" />
|
<Search className="absolute left-3.5 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground" />
|
||||||
<Input
|
<Input
|
||||||
placeholder="Search providers..."
|
placeholder="Search providers..."
|
||||||
value={searchQuery}
|
value={searchQuery}
|
||||||
onChange={(e) => setSearchQuery(e.target.value)}
|
onChange={(e) => setSearchQuery(e.target.value)}
|
||||||
className="pl-10 bg-white dark:bg-slate-900 border-slate-200 dark:border-slate-800 focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-0"
|
className="pl-10 bg-card border-border focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-0"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -232,19 +232,17 @@ export function ProvidersSettings({ teamId }: ProvidersSettingsProps) {
|
|||||||
{filteredProviders.map((provider) => (
|
{filteredProviders.map((provider) => (
|
||||||
<Card
|
<Card
|
||||||
key={provider.id}
|
key={provider.id}
|
||||||
className="group cursor-pointer hover:border-blue-300 dark:hover:border-blue-700 transition-all hover:shadow-md overflow-hidden"
|
className="group cursor-pointer hover:border-primary/50 transition-all hover:shadow-md overflow-hidden"
|
||||||
onClick={() => setEditingProviderId(provider.id)}
|
onClick={() => setEditingProviderId(provider.id)}
|
||||||
>
|
>
|
||||||
<CardContent className="p-5 flex items-center justify-between gap-4">
|
<CardContent className="p-5 flex items-center justify-between gap-4">
|
||||||
<div className="flex items-center gap-4 min-w-0 flex-1">
|
<div className="flex items-center gap-4 min-w-0 flex-1">
|
||||||
<div className="flex-none p-3 bg-slate-100 dark:bg-slate-800 rounded-xl group-hover:bg-blue-50 dark:group-hover:bg-blue-900/20 transition-colors">
|
<div className="flex-none p-3 bg-muted rounded-xl group-hover:bg-primary/10 transition-colors">
|
||||||
<Globe className="w-6 h-6 text-slate-600 dark:text-slate-400 group-hover:text-blue-600 dark:group-hover:text-blue-400" />
|
<Globe className="w-6 h-6 text-muted-foreground group-hover:text-primary" />
|
||||||
</div>
|
</div>
|
||||||
<div className="min-w-0 flex-1">
|
<div className="min-w-0 flex-1">
|
||||||
<div className="flex items-center gap-2">
|
<div className="flex items-center gap-2">
|
||||||
<span className="font-bold text-slate-900 dark:text-white truncate">
|
<span className="font-bold text-foreground truncate">{provider.name}</span>
|
||||||
{provider.name}
|
|
||||||
</span>
|
|
||||||
{provider.isBuiltin && (
|
{provider.isBuiltin && (
|
||||||
<Badge
|
<Badge
|
||||||
variant="secondary"
|
variant="secondary"
|
||||||
@@ -254,14 +252,14 @@ export function ProvidersSettings({ teamId }: ProvidersSettingsProps) {
|
|||||||
</Badge>
|
</Badge>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
<div className="flex flex-wrap items-center gap-x-3 gap-y-1.5 text-xs text-slate-500 mt-1">
|
<div className="flex flex-wrap items-center gap-x-3 gap-y-1.5 text-xs text-muted-foreground mt-1">
|
||||||
<span className="flex items-center gap-1 flex-none">
|
<span className="flex items-center gap-1 flex-none">
|
||||||
<Zap className="w-3 h-3" />
|
<Zap className="w-3 h-3" />
|
||||||
{provider.config.api}
|
{provider.config.api}
|
||||||
</span>
|
</span>
|
||||||
{provider.config.baseUrl && (
|
{provider.config.baseUrl && (
|
||||||
<span className="flex items-center gap-1 min-w-0">
|
<span className="flex items-center gap-1 min-w-0">
|
||||||
<span className="h-1 w-1 rounded-full bg-slate-300 dark:bg-slate-700 flex-none" />
|
<span className="h-1 w-1 rounded-full bg-muted-foreground/30 flex-none" />
|
||||||
<Info className="w-3 h-3 flex-none" />
|
<Info className="w-3 h-3 flex-none" />
|
||||||
<span className="truncate max-w-[200px] md:max-w-[300px]">
|
<span className="truncate max-w-[200px] md:max-w-[300px]">
|
||||||
{provider.config.baseUrl}
|
{provider.config.baseUrl}
|
||||||
@@ -269,7 +267,7 @@ export function ProvidersSettings({ teamId }: ProvidersSettingsProps) {
|
|||||||
</span>
|
</span>
|
||||||
)}
|
)}
|
||||||
<span className="flex items-center gap-1 flex-none">
|
<span className="flex items-center gap-1 flex-none">
|
||||||
<span className="h-1 w-1 rounded-full bg-slate-300 dark:bg-slate-700 flex-none" />
|
<span className="h-1 w-1 rounded-full bg-muted-foreground/30 flex-none" />
|
||||||
<Maximize2 className="w-3 h-3" />
|
<Maximize2 className="w-3 h-3" />
|
||||||
{provider.modelsCount} Models
|
{provider.modelsCount} Models
|
||||||
{editingProviderId === provider.id && isModelsLoading && (
|
{editingProviderId === provider.id && isModelsLoading && (
|
||||||
@@ -286,7 +284,7 @@ export function ProvidersSettings({ teamId }: ProvidersSettingsProps) {
|
|||||||
<Button
|
<Button
|
||||||
variant="ghost"
|
variant="ghost"
|
||||||
size="icon"
|
size="icon"
|
||||||
className="h-8 w-8 text-slate-400 hover:text-slate-600 dark:hover:text-slate-300"
|
className="h-8 w-8 text-muted-foreground hover:text-foreground"
|
||||||
>
|
>
|
||||||
<MoreVertical className="w-4 h-4" />
|
<MoreVertical className="w-4 h-4" />
|
||||||
</Button>
|
</Button>
|
||||||
@@ -299,25 +297,23 @@ export function ProvidersSettings({ teamId }: ProvidersSettingsProps) {
|
|||||||
setProviderToDelete(provider)
|
setProviderToDelete(provider)
|
||||||
setIsDeleteDialogOpen(true)
|
setIsDeleteDialogOpen(true)
|
||||||
}}
|
}}
|
||||||
className="text-red-500 focus:text-red-500 gap-2 cursor-pointer"
|
className="text-destructive focus:text-destructive gap-2 cursor-pointer"
|
||||||
>
|
>
|
||||||
<Trash2 className="w-4 h-4" /> Delete
|
<Trash2 className="w-4 h-4" /> Delete
|
||||||
</DropdownMenuItem>
|
</DropdownMenuItem>
|
||||||
</DropdownMenuContent>
|
</DropdownMenuContent>
|
||||||
</DropdownMenu>
|
</DropdownMenu>
|
||||||
<ChevronRight className="flex-none w-5 h-5 text-slate-300 group-hover:text-blue-500 transition-colors" />
|
<ChevronRight className="flex-none w-5 h-5 text-muted-foreground/50 group-hover:text-primary transition-colors" />
|
||||||
</div>
|
</div>
|
||||||
</CardContent>
|
</CardContent>
|
||||||
</Card>
|
</Card>
|
||||||
))}
|
))}
|
||||||
|
|
||||||
{providers?.length === 0 && (
|
{providers?.length === 0 && (
|
||||||
<div className="text-center py-12 bg-slate-50 dark:bg-slate-900/50 rounded-2xl border-2 border-dashed border-slate-200 dark:border-slate-800">
|
<div className="text-center py-12 bg-muted/30 rounded-2xl border-2 border-dashed border-border">
|
||||||
<Cpu className="w-12 h-12 text-slate-300 mx-auto mb-4" />
|
<Cpu className="w-12 h-12 text-muted-foreground/50 mx-auto mb-4" />
|
||||||
<h4 className="text-slate-900 dark:text-white font-medium">
|
<h4 className="text-foreground font-medium">No Providers Configured</h4>
|
||||||
No Providers Configured
|
<p className="text-sm text-muted-foreground mt-1">
|
||||||
</h4>
|
|
||||||
<p className="text-sm text-slate-500 mt-1">
|
|
||||||
Add your first AI provider to get started.
|
Add your first AI provider to get started.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
@@ -325,16 +321,16 @@ export function ProvidersSettings({ teamId }: ProvidersSettingsProps) {
|
|||||||
|
|
||||||
{providers && providers.length > 0 && filteredProviders.length === 0 && (
|
{providers && providers.length > 0 && filteredProviders.length === 0 && (
|
||||||
<div className="text-center py-12">
|
<div className="text-center py-12">
|
||||||
<Search className="w-12 h-12 text-slate-300 mx-auto mb-4" />
|
<Search className="w-12 h-12 text-muted-foreground/50 mx-auto mb-4" />
|
||||||
<h4 className="text-slate-900 dark:text-white font-medium">No matches found</h4>
|
<h4 className="text-foreground font-medium">No matches found</h4>
|
||||||
<p className="text-sm text-slate-500 mt-1">
|
<p className="text-sm text-muted-foreground mt-1">
|
||||||
Try adjusting your search for "{searchQuery}"
|
Try adjusting your search for "{searchQuery}"
|
||||||
</p>
|
</p>
|
||||||
<Button
|
<Button
|
||||||
variant="ghost"
|
variant="ghost"
|
||||||
size="sm"
|
size="sm"
|
||||||
onClick={() => setSearchQuery('')}
|
onClick={() => setSearchQuery('')}
|
||||||
className="mt-4 text-blue-600 hover:text-blue-700 hover:bg-blue-50 dark:hover:bg-blue-900/20"
|
className="mt-4 text-primary hover:text-primary/90 hover:bg-primary/10"
|
||||||
>
|
>
|
||||||
Clear search
|
Clear search
|
||||||
</Button>
|
</Button>
|
||||||
@@ -383,7 +379,7 @@ export function ProvidersSettings({ teamId }: ProvidersSettingsProps) {
|
|||||||
<AlertDialogFooter>
|
<AlertDialogFooter>
|
||||||
<AlertDialogCancel onClick={() => setProviderToDelete(null)}>Cancel</AlertDialogCancel>
|
<AlertDialogCancel onClick={() => setProviderToDelete(null)}>Cancel</AlertDialogCancel>
|
||||||
<AlertDialogAction
|
<AlertDialogAction
|
||||||
className="bg-red-600 hover:bg-red-700 text-white"
|
className="bg-destructive hover:bg-destructive/90 text-white"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
if (providerToDelete) {
|
if (providerToDelete) {
|
||||||
deleteMutation.mutate(providerToDelete.id)
|
deleteMutation.mutate(providerToDelete.id)
|
||||||
|
|||||||
@@ -89,10 +89,10 @@ export const SkillsConfigCard: React.FC<SkillsConfigCardProps> = ({ teamId }) =>
|
|||||||
const skills = data?.skills || []
|
const skills = data?.skills || []
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Card className="border-slate-200 dark:border-slate-800">
|
<Card>
|
||||||
<CardHeader className="flex flex-row items-center justify-between space-y-0 pb-7">
|
<CardHeader className="flex flex-row items-center justify-between space-y-0 pb-7">
|
||||||
<div className="flex items-center gap-3">
|
<div className="flex items-center gap-3">
|
||||||
<div className="p-2 bg-blue-50 dark:bg-blue-900/20 text-blue-600 dark:text-blue-400 rounded-lg">
|
<div className="p-2 bg-primary/10 text-primary rounded-lg">
|
||||||
<Puzzle className="w-6 h-6" />
|
<Puzzle className="w-6 h-6" />
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
@@ -109,17 +109,15 @@ export const SkillsConfigCard: React.FC<SkillsConfigCardProps> = ({ teamId }) =>
|
|||||||
<CardContent>
|
<CardContent>
|
||||||
{isLoading ? (
|
{isLoading ? (
|
||||||
<div className="flex justify-center py-10">
|
<div className="flex justify-center py-10">
|
||||||
<Loader2 className="w-8 h-8 animate-spin text-blue-500" />
|
<Loader2 className="w-8 h-8 animate-spin text-primary" />
|
||||||
</div>
|
</div>
|
||||||
) : skills.length === 0 ? (
|
) : skills.length === 0 ? (
|
||||||
<div className="text-center py-12 border-2 border-dashed border-slate-200 dark:border-slate-800 rounded-xl">
|
<div className="text-center py-12 border-2 border-dashed border-border rounded-xl">
|
||||||
<div className="mx-auto w-12 h-12 bg-slate-50 dark:bg-slate-900 rounded-full flex items-center justify-center mb-4 text-slate-400">
|
<div className="mx-auto w-12 h-12 bg-muted rounded-full flex items-center justify-center mb-4 text-muted-foreground">
|
||||||
<Puzzle className="w-6 h-6" />
|
<Puzzle className="w-6 h-6" />
|
||||||
</div>
|
</div>
|
||||||
<h3 className="text-lg font-medium text-slate-900 dark:text-white">
|
<h3 className="text-lg font-medium text-foreground">No skills installed</h3>
|
||||||
No skills installed
|
<p className="text-muted-foreground mt-1 max-w-xs mx-auto">
|
||||||
</h3>
|
|
||||||
<p className="text-slate-500 dark:text-slate-400 mt-1 max-w-xs mx-auto">
|
|
||||||
Add a skill via GitHub URL or upload a ZIP file to get started.
|
Add a skill via GitHub URL or upload a ZIP file to get started.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
@@ -174,7 +172,7 @@ export const SkillsConfigCard: React.FC<SkillsConfigCardProps> = ({ teamId }) =>
|
|||||||
<AlertDialogFooter>
|
<AlertDialogFooter>
|
||||||
<AlertDialogCancel>Cancel</AlertDialogCancel>
|
<AlertDialogCancel>Cancel</AlertDialogCancel>
|
||||||
<AlertDialogAction
|
<AlertDialogAction
|
||||||
className="bg-red-600 hover:bg-red-700 text-white"
|
className="bg-destructive hover:bg-destructive/90 text-white"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
if (selectedSkill) {
|
if (selectedSkill) {
|
||||||
deleteMutation.mutate(selectedSkill.id)
|
deleteMutation.mutate(selectedSkill.id)
|
||||||
@@ -206,14 +204,12 @@ const SkillItem = ({
|
|||||||
}) => {
|
}) => {
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
className="p-4 bg-white dark:bg-slate-900 rounded-xl border border-slate-200 dark:border-slate-800 flex flex-col justify-between hover:shadow-md transition-all group cursor-pointer"
|
className="p-4 bg-card rounded-xl border border-border flex flex-col justify-between hover:shadow-md transition-all group cursor-pointer"
|
||||||
onClick={onConfigure}
|
onClick={onConfigure}
|
||||||
>
|
>
|
||||||
<div>
|
<div>
|
||||||
<div className="flex items-start justify-between mb-2">
|
<div className="flex items-start justify-between mb-2">
|
||||||
<h4 className="font-bold text-slate-900 dark:text-white flex items-center gap-2">
|
<h4 className="font-bold text-foreground flex items-center gap-2">{skill.name}</h4>
|
||||||
{skill.name}
|
|
||||||
</h4>
|
|
||||||
<DropdownMenu>
|
<DropdownMenu>
|
||||||
<DropdownMenuTrigger asChild onClick={(e) => e.stopPropagation()}>
|
<DropdownMenuTrigger asChild onClick={(e) => e.stopPropagation()}>
|
||||||
<Button variant="ghost" size="icon" className="h-8 w-8">
|
<Button variant="ghost" size="icon" className="h-8 w-8">
|
||||||
@@ -233,15 +229,13 @@ const SkillItem = ({
|
|||||||
</DropdownMenuContent>
|
</DropdownMenuContent>
|
||||||
</DropdownMenu>
|
</DropdownMenu>
|
||||||
</div>
|
</div>
|
||||||
<p className="text-sm text-slate-500 dark:text-slate-400 line-clamp-2">
|
<p className="text-sm text-muted-foreground line-clamp-2">
|
||||||
{skill.description || 'No description provided.'}
|
{skill.description || 'No description provided.'}
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<div className="mt-4 flex items-center justify-between text-[10px] text-slate-400 dark:text-slate-500 uppercase tracking-wider font-semibold">
|
<div className="mt-4 flex items-center justify-between text-[10px] text-muted-foreground uppercase tracking-wider font-semibold">
|
||||||
<span>Updated {new Date(skill.updatedAt).toLocaleDateString()}</span>
|
<span>Updated {new Date(skill.updatedAt).toLocaleDateString()}</span>
|
||||||
<div className="px-2 py-0.5 rounded-full bg-blue-50 dark:bg-blue-900/20 text-blue-600 dark:text-blue-400">
|
<div className="px-2 py-0.5 rounded-full bg-primary/10 text-primary">Installed</div>
|
||||||
Installed
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -10,15 +10,15 @@ function UploadTaskItem({ task }: { task: TaskInfo }) {
|
|||||||
const progress =
|
const progress =
|
||||||
task.total && task.total > 0 ? `${((task.uploaded ?? 0) / task.total) * 100}%` : '0%'
|
task.total && task.total > 0 ? `${((task.uploaded ?? 0) / task.total) * 100}%` : '0%'
|
||||||
return (
|
return (
|
||||||
<div className="p-2 rounded-md transition-colors hover:bg-slate-100 dark:hover:bg-slate-800">
|
<div className="p-2 rounded-md transition-colors hover:bg-sidebar-accent">
|
||||||
<div className="flex items-center justify-between">
|
<div className="flex items-center justify-between">
|
||||||
<span className="text-sm font-medium truncate">{task.name ?? 'unknown'}</span>
|
<span className="text-sm font-medium truncate">{task.name ?? 'unknown'}</span>
|
||||||
<span className="text-xs text-slate-500 dark:text-slate-400">
|
<span className="text-xs text-muted-foreground">
|
||||||
{task.uploaded}/{task.total}
|
{task.uploaded}/{task.total}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div className="mt-1 h-1 w-full bg-slate-200 dark:bg-slate-700 rounded-full">
|
<div className="mt-1 h-1 w-full bg-muted rounded-full">
|
||||||
<div className="h-1 bg-blue-600 rounded-full" style={{ width: progress }} />
|
<div className="h-1 bg-primary rounded-full" style={{ width: progress }} />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
|
|||||||
+60
-52
@@ -8,64 +8,72 @@
|
|||||||
@custom-variant dark (&:is(.dark *));
|
@custom-variant dark (&:is(.dark *));
|
||||||
|
|
||||||
:root {
|
:root {
|
||||||
--background: oklch(0.98 0 0);
|
--background: oklch(1 0 0);
|
||||||
--foreground: oklch(0.15 0 0);
|
--foreground: oklch(0.153 0.006 107.1);
|
||||||
--card: oklch(1 0 0);
|
--card: oklch(1 0 0);
|
||||||
--card-foreground: oklch(0.15 0 0);
|
--card-foreground: oklch(0.153 0.006 107.1);
|
||||||
--popover: oklch(1 0 0);
|
--popover: oklch(1 0 0);
|
||||||
--popover-foreground: oklch(0.15 0 0);
|
--popover-foreground: oklch(0.153 0.006 107.1);
|
||||||
--primary: oklch(0.58 0.18 252);
|
--primary: oklch(0.553 0.195 38.402);
|
||||||
--primary-foreground: oklch(1 0 0);
|
--primary-foreground: oklch(0.98 0.016 73.684);
|
||||||
--secondary: oklch(0.96 0 0);
|
--secondary: oklch(0.967 0.001 286.375);
|
||||||
--secondary-foreground: oklch(0.15 0 0);
|
--secondary-foreground: oklch(0.21 0.006 285.885);
|
||||||
--muted: oklch(0.94 0 0);
|
--muted: oklch(0.966 0.005 106.5);
|
||||||
--muted-foreground: oklch(0.5 0 0);
|
--muted-foreground: oklch(0.58 0.031 107.3);
|
||||||
--accent: oklch(0.96 0 0);
|
--accent: oklch(0.966 0.005 106.5);
|
||||||
--accent-foreground: oklch(0.15 0 0);
|
--accent-foreground: oklch(0.228 0.013 107.4);
|
||||||
--destructive: oklch(0.577 0.245 27.325);
|
--destructive: oklch(0.577 0.245 27.325);
|
||||||
--destructive-foreground: oklch(1 0 0);
|
--border: oklch(0.93 0.007 106.5);
|
||||||
--border: oklch(0.88 0 0);
|
--input: oklch(0.93 0.007 106.5);
|
||||||
--input: oklch(0.92 0 0);
|
--ring: oklch(0.737 0.021 106.9);
|
||||||
--ring: oklch(0.58 0.18 252);
|
--chart-1: oklch(0.879 0.169 91.605);
|
||||||
--radius: 0.5rem;
|
--chart-2: oklch(0.769 0.188 70.08);
|
||||||
--sidebar: oklch(0.97 0 0);
|
--chart-3: oklch(0.666 0.179 58.318);
|
||||||
--sidebar-foreground: oklch(0.2 0 0);
|
--chart-4: oklch(0.555 0.163 48.998);
|
||||||
--sidebar-primary: oklch(0.58 0.18 252);
|
--chart-5: oklch(0.473 0.137 46.201);
|
||||||
--sidebar-primary-foreground: oklch(1 0 0);
|
--radius: 0.625rem;
|
||||||
--sidebar-accent: oklch(0.93 0 0);
|
--sidebar: oklch(0.988 0.003 106.5);
|
||||||
--sidebar-accent-foreground: oklch(0.15 0 0);
|
--sidebar-foreground: oklch(0.153 0.006 107.1);
|
||||||
--sidebar-border: oklch(0.88 0 0);
|
--sidebar-primary: oklch(0.646 0.222 41.116);
|
||||||
--sidebar-ring: oklch(0.58 0.18 252);
|
--sidebar-primary-foreground: oklch(0.98 0.016 73.684);
|
||||||
|
--sidebar-accent: oklch(0.966 0.005 106.5);
|
||||||
|
--sidebar-accent-foreground: oklch(0.228 0.013 107.4);
|
||||||
|
--sidebar-border: oklch(0.93 0.007 106.5);
|
||||||
|
--sidebar-ring: oklch(0.737 0.021 106.9);
|
||||||
}
|
}
|
||||||
|
|
||||||
.dark {
|
.dark {
|
||||||
--background: oklch(0.12 0 0);
|
--background: oklch(0.153 0.006 107.1);
|
||||||
--foreground: oklch(0.92 0 0);
|
--foreground: oklch(0.988 0.003 106.5);
|
||||||
--card: oklch(0.15 0 0);
|
--card: oklch(0.228 0.013 107.4);
|
||||||
--card-foreground: oklch(0.92 0 0);
|
--card-foreground: oklch(0.988 0.003 106.5);
|
||||||
--popover: oklch(0.18 0 0);
|
--popover: oklch(0.228 0.013 107.4);
|
||||||
--popover-foreground: oklch(0.92 0 0);
|
--popover-foreground: oklch(0.988 0.003 106.5);
|
||||||
--primary: oklch(0.58 0.18 252);
|
--primary: oklch(0.47 0.157 37.304);
|
||||||
--primary-foreground: oklch(1 0 0);
|
--primary-foreground: oklch(0.98 0.016 73.684);
|
||||||
--secondary: oklch(0.22 0 0);
|
--secondary: oklch(0.274 0.006 286.033);
|
||||||
--secondary-foreground: oklch(0.92 0 0);
|
--secondary-foreground: oklch(0.985 0 0);
|
||||||
--muted: oklch(0.2 0 0);
|
--muted: oklch(0.286 0.016 107.4);
|
||||||
--muted-foreground: oklch(0.6 0 0);
|
--muted-foreground: oklch(0.737 0.021 106.9);
|
||||||
--accent: oklch(0.25 0 0);
|
--accent: oklch(0.286 0.016 107.4);
|
||||||
--accent-foreground: oklch(0.92 0 0);
|
--accent-foreground: oklch(0.988 0.003 106.5);
|
||||||
--destructive: oklch(0.48 0.2 25);
|
--destructive: oklch(0.704 0.191 22.216);
|
||||||
--destructive-foreground: oklch(1 0 0);
|
--border: oklch(1 0 0 / 10%);
|
||||||
--border: oklch(0.25 0 0);
|
--input: oklch(1 0 0 / 15%);
|
||||||
--input: oklch(0.22 0 0);
|
--ring: oklch(0.58 0.031 107.3);
|
||||||
--ring: oklch(0.58 0.18 252);
|
--chart-1: oklch(0.879 0.169 91.605);
|
||||||
--sidebar: oklch(0.16 0 0);
|
--chart-2: oklch(0.769 0.188 70.08);
|
||||||
--sidebar-foreground: oklch(0.85 0 0);
|
--chart-3: oklch(0.666 0.179 58.318);
|
||||||
--sidebar-primary: oklch(0.58 0.18 252);
|
--chart-4: oklch(0.555 0.163 48.998);
|
||||||
--sidebar-primary-foreground: oklch(1 0 0);
|
--chart-5: oklch(0.473 0.137 46.201);
|
||||||
--sidebar-accent: oklch(0.22 0 0);
|
--sidebar: oklch(0.228 0.013 107.4);
|
||||||
--sidebar-accent-foreground: oklch(0.92 0 0);
|
--sidebar-foreground: oklch(0.988 0.003 106.5);
|
||||||
--sidebar-border: oklch(0.25 0 0);
|
--sidebar-primary: oklch(0.705 0.213 47.604);
|
||||||
--sidebar-ring: oklch(0.58 0.18 252);
|
--sidebar-primary-foreground: oklch(0.98 0.016 73.684);
|
||||||
|
--sidebar-accent: oklch(0.286 0.016 107.4);
|
||||||
|
--sidebar-accent-foreground: oklch(0.988 0.003 106.5);
|
||||||
|
--sidebar-border: oklch(1 0 0 / 10%);
|
||||||
|
--sidebar-ring: oklch(0.58 0.031 107.3);
|
||||||
}
|
}
|
||||||
|
|
||||||
@theme inline {
|
@theme inline {
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import { client } from '@/ui/api/client'
|
||||||
import { DualSidebar, DualSidebarItem } from '@/ui/components/dual-sidebar'
|
import { DualSidebar, DualSidebarItem } from '@/ui/components/dual-sidebar'
|
||||||
import { NotificationList } from '@/ui/components/notification-list'
|
import { NotificationList } from '@/ui/components/notification-list'
|
||||||
import { TopNav } from '@/ui/components/top-nav'
|
import { TopNav } from '@/ui/components/top-nav'
|
||||||
@@ -7,14 +8,13 @@ import { UploadTasks } from '@/ui/components/upload-tasks'
|
|||||||
import { useAuthStore } from '@/ui/stores/auth'
|
import { useAuthStore } from '@/ui/stores/auth'
|
||||||
import { useTeamContextStore } from '@/ui/stores/team-context'
|
import { useTeamContextStore } from '@/ui/stores/team-context'
|
||||||
import { useUploadStore } from '@/ui/stores/upload'
|
import { useUploadStore } from '@/ui/stores/upload'
|
||||||
|
import { useQuery } from '@tanstack/react-query'
|
||||||
import {
|
import {
|
||||||
createRootRouteWithContext,
|
createRootRouteWithContext,
|
||||||
Outlet,
|
Outlet,
|
||||||
useNavigate,
|
useNavigate,
|
||||||
useRouterState,
|
useRouterState,
|
||||||
} from '@tanstack/react-router'
|
} from '@tanstack/react-router'
|
||||||
import { useQuery } from '@tanstack/react-query'
|
|
||||||
import { client } from '@/ui/api/client'
|
|
||||||
import { useEffect } from 'react'
|
import { useEffect } from 'react'
|
||||||
|
|
||||||
function RootComponent() {
|
function RootComponent() {
|
||||||
|
|||||||
@@ -103,12 +103,12 @@ function TeamSettingsPage() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="h-full bg-slate-50 dark:bg-slate-950 font-sans selection:bg-blue-100 dark:selection:bg-blue-900 transition-colors duration-300">
|
<div className="h-full bg-background font-sans selection:bg-primary/20 transition-colors duration-300">
|
||||||
<div className="flex flex-col md:flex-row h-full">
|
<div className="flex flex-col md:flex-row h-full">
|
||||||
{/* Sidebar */}
|
{/* Sidebar */}
|
||||||
<div className="w-full h-full md:w-72 bg-white dark:bg-slate-900 border-b md:border-b-0 md:border-r border-slate-200 dark:border-slate-800 z-10 md:left-16 overflow-y-auto transition-colors duration-300">
|
<div className="w-full h-full md:w-72 bg-sidebar border-b md:border-b-0 md:border-r border-sidebar-border z-10 md:left-16 overflow-y-auto transition-colors duration-300">
|
||||||
<nav className="p-4 space-y-1 mt-4">
|
<nav className="p-4 space-y-1 mt-4">
|
||||||
<div className="mb-2 px-4 text-xs font-semibold text-slate-400 dark:text-slate-500 uppercase tracking-wider">
|
<div className="mb-2 px-4 text-xs font-semibold text-sidebar-foreground/60 uppercase tracking-wider">
|
||||||
Settings
|
Settings
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -117,14 +117,14 @@ function TeamSettingsPage() {
|
|||||||
className={cn(
|
className={cn(
|
||||||
'w-full flex items-center gap-3 px-4 py-3 text-sm font-medium rounded-lg transition-all',
|
'w-full flex items-center gap-3 px-4 py-3 text-sm font-medium rounded-lg transition-all',
|
||||||
activeTab === 'general'
|
activeTab === 'general'
|
||||||
? 'bg-blue-50 dark:bg-blue-900/20 text-blue-700 dark:text-blue-300 ring-1 ring-blue-200 dark:ring-blue-800'
|
? 'bg-sidebar-accent text-sidebar-accent-foreground ring-1 ring-sidebar-border'
|
||||||
: 'text-slate-600 dark:text-slate-400 hover:bg-slate-50 dark:hover:bg-slate-800 hover:text-slate-900 dark:hover:text-white',
|
: 'text-sidebar-foreground/75 hover:bg-sidebar-accent hover:text-sidebar-accent-foreground',
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
<User className="w-5 h-5" />
|
<User className="w-5 h-5" />
|
||||||
General
|
General
|
||||||
{activeTab === 'general' && (
|
{activeTab === 'general' && (
|
||||||
<div className="ml-auto w-1.5 h-1.5 rounded-full bg-blue-600 dark:bg-blue-400" />
|
<div className="ml-auto w-1.5 h-1.5 rounded-full bg-sidebar-primary" />
|
||||||
)}
|
)}
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
@@ -133,14 +133,14 @@ function TeamSettingsPage() {
|
|||||||
className={cn(
|
className={cn(
|
||||||
'w-full flex items-center gap-3 px-4 py-3 text-sm font-medium rounded-lg transition-all',
|
'w-full flex items-center gap-3 px-4 py-3 text-sm font-medium rounded-lg transition-all',
|
||||||
activeTab === 'transcode'
|
activeTab === 'transcode'
|
||||||
? 'bg-blue-50 dark:bg-blue-900/20 text-blue-700 dark:text-blue-300 ring-1 ring-blue-200 dark:ring-blue-800'
|
? 'bg-sidebar-accent text-sidebar-accent-foreground ring-1 ring-sidebar-border'
|
||||||
: 'text-slate-600 dark:text-slate-400 hover:bg-slate-50 dark:hover:bg-slate-800 hover:text-slate-900 dark:hover:text-white',
|
: 'text-sidebar-foreground/75 hover:bg-sidebar-accent hover:text-sidebar-accent-foreground',
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
<Film className="w-5 h-5" />
|
<Film className="w-5 h-5" />
|
||||||
Media Processing
|
Media Processing
|
||||||
{activeTab === 'transcode' && (
|
{activeTab === 'transcode' && (
|
||||||
<div className="ml-auto w-1.5 h-1.5 rounded-full bg-blue-600 dark:bg-blue-400" />
|
<div className="ml-auto w-1.5 h-1.5 rounded-full bg-sidebar-primary" />
|
||||||
)}
|
)}
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
@@ -149,18 +149,18 @@ function TeamSettingsPage() {
|
|||||||
className={cn(
|
className={cn(
|
||||||
'w-full flex items-center gap-3 px-4 py-3 text-sm font-medium rounded-lg transition-all',
|
'w-full flex items-center gap-3 px-4 py-3 text-sm font-medium rounded-lg transition-all',
|
||||||
activeTab === 'notifications'
|
activeTab === 'notifications'
|
||||||
? 'bg-blue-50 dark:bg-blue-900/20 text-blue-700 dark:text-blue-300 ring-1 ring-blue-200 dark:ring-blue-800'
|
? 'bg-sidebar-accent text-sidebar-accent-foreground ring-1 ring-sidebar-border'
|
||||||
: 'text-slate-600 dark:text-slate-400 hover:bg-slate-50 dark:hover:bg-slate-800 hover:text-slate-900 dark:hover:text-white',
|
: 'text-sidebar-foreground/75 hover:bg-sidebar-accent hover:text-sidebar-accent-foreground',
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
<Bell className="w-5 h-5" />
|
<Bell className="w-5 h-5" />
|
||||||
Notifications
|
Notifications
|
||||||
{activeTab === 'notifications' && (
|
{activeTab === 'notifications' && (
|
||||||
<div className="ml-auto w-1.5 h-1.5 rounded-full bg-blue-600 dark:bg-blue-400" />
|
<div className="ml-auto w-1.5 h-1.5 rounded-full bg-sidebar-primary" />
|
||||||
)}
|
)}
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
<div className="mt-6 mb-2 px-4 text-xs font-semibold text-slate-400 dark:text-slate-500 uppercase tracking-wider pt-4 border-t border-slate-100 dark:border-slate-800">
|
<div className="mt-6 mb-2 px-4 text-xs font-semibold text-sidebar-foreground/60 uppercase tracking-wider pt-4 border-t border-sidebar-border">
|
||||||
AI
|
AI
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -169,14 +169,14 @@ function TeamSettingsPage() {
|
|||||||
className={cn(
|
className={cn(
|
||||||
'w-full flex items-center gap-3 px-4 py-3 text-sm font-medium rounded-lg transition-all',
|
'w-full flex items-center gap-3 px-4 py-3 text-sm font-medium rounded-lg transition-all',
|
||||||
activeTab === 'providers'
|
activeTab === 'providers'
|
||||||
? 'bg-blue-50 dark:bg-blue-900/20 text-blue-700 dark:text-blue-300 ring-1 ring-blue-200 dark:ring-blue-800'
|
? 'bg-sidebar-accent text-sidebar-accent-foreground ring-1 ring-sidebar-border'
|
||||||
: 'text-slate-600 dark:text-slate-400 hover:bg-slate-50 dark:hover:bg-slate-800 hover:text-slate-900 dark:hover:text-white',
|
: 'text-sidebar-foreground/75 hover:bg-sidebar-accent hover:text-sidebar-accent-foreground',
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
<Cpu className="w-5 h-5" />
|
<Cpu className="w-5 h-5" />
|
||||||
Providers
|
Providers
|
||||||
{activeTab === 'providers' && (
|
{activeTab === 'providers' && (
|
||||||
<div className="ml-auto w-1.5 h-1.5 rounded-full bg-blue-600 dark:bg-blue-400" />
|
<div className="ml-auto w-1.5 h-1.5 rounded-full bg-sidebar-primary" />
|
||||||
)}
|
)}
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
@@ -185,14 +185,14 @@ function TeamSettingsPage() {
|
|||||||
className={cn(
|
className={cn(
|
||||||
'w-full flex items-center gap-3 px-4 py-3 text-sm font-medium rounded-lg transition-all',
|
'w-full flex items-center gap-3 px-4 py-3 text-sm font-medium rounded-lg transition-all',
|
||||||
activeTab === 'skills'
|
activeTab === 'skills'
|
||||||
? 'bg-blue-50 dark:bg-blue-900/20 text-blue-700 dark:text-blue-300 ring-1 ring-blue-200 dark:ring-blue-800'
|
? 'bg-sidebar-accent text-sidebar-accent-foreground ring-1 ring-sidebar-border'
|
||||||
: 'text-slate-600 dark:text-slate-400 hover:bg-slate-50 dark:hover:bg-slate-800 hover:text-slate-900 dark:hover:text-white',
|
: 'text-sidebar-foreground/75 hover:bg-sidebar-accent hover:text-sidebar-accent-foreground',
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
<Puzzle className="w-5 h-5" />
|
<Puzzle className="w-5 h-5" />
|
||||||
Skills
|
Skills
|
||||||
{activeTab === 'skills' && (
|
{activeTab === 'skills' && (
|
||||||
<div className="ml-auto w-1.5 h-1.5 rounded-full bg-blue-600 dark:bg-blue-400" />
|
<div className="ml-auto w-1.5 h-1.5 rounded-full bg-sidebar-primary" />
|
||||||
)}
|
)}
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
@@ -201,14 +201,14 @@ function TeamSettingsPage() {
|
|||||||
className={cn(
|
className={cn(
|
||||||
'w-full flex items-center gap-3 px-4 py-3 text-sm font-medium rounded-lg transition-all',
|
'w-full flex items-center gap-3 px-4 py-3 text-sm font-medium rounded-lg transition-all',
|
||||||
activeTab === 'agents'
|
activeTab === 'agents'
|
||||||
? 'bg-blue-50 dark:bg-blue-900/20 text-blue-700 dark:text-blue-300 ring-1 ring-blue-200 dark:ring-blue-800'
|
? 'bg-sidebar-accent text-sidebar-accent-foreground ring-1 ring-sidebar-border'
|
||||||
: 'text-slate-600 dark:text-slate-400 hover:bg-slate-50 dark:hover:bg-slate-800 hover:text-slate-900 dark:hover:text-white',
|
: 'text-sidebar-foreground/75 hover:bg-sidebar-accent hover:text-sidebar-accent-foreground',
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
<Bot className="w-5 h-5" />
|
<Bot className="w-5 h-5" />
|
||||||
Agents
|
Agents
|
||||||
{activeTab === 'agents' && (
|
{activeTab === 'agents' && (
|
||||||
<div className="ml-auto w-1.5 h-1.5 rounded-full bg-blue-600 dark:bg-blue-400" />
|
<div className="ml-auto w-1.5 h-1.5 rounded-full bg-sidebar-primary" />
|
||||||
)}
|
)}
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
@@ -217,25 +217,25 @@ function TeamSettingsPage() {
|
|||||||
className={cn(
|
className={cn(
|
||||||
'w-full flex items-center gap-3 px-4 py-3 text-sm font-medium rounded-lg transition-all',
|
'w-full flex items-center gap-3 px-4 py-3 text-sm font-medium rounded-lg transition-all',
|
||||||
activeTab === 'sandbox'
|
activeTab === 'sandbox'
|
||||||
? 'bg-blue-50 dark:bg-blue-900/20 text-blue-700 dark:text-blue-300 ring-1 ring-blue-200 dark:ring-blue-800'
|
? 'bg-sidebar-accent text-sidebar-accent-foreground ring-1 ring-sidebar-border'
|
||||||
: 'text-slate-600 dark:text-slate-400 hover:bg-slate-50 dark:hover:bg-slate-800 hover:text-slate-900 dark:hover:text-white',
|
: 'text-sidebar-foreground/75 hover:bg-sidebar-accent hover:text-sidebar-accent-foreground',
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
<Shield className="w-5 h-5" />
|
<Shield className="w-5 h-5" />
|
||||||
Agent Sandbox
|
Agent Sandbox
|
||||||
{activeTab === 'sandbox' && (
|
{activeTab === 'sandbox' && (
|
||||||
<div className="ml-auto w-1.5 h-1.5 rounded-full bg-blue-600 dark:bg-blue-400" />
|
<div className="ml-auto w-1.5 h-1.5 rounded-full bg-sidebar-primary" />
|
||||||
)}
|
)}
|
||||||
</button>
|
</button>
|
||||||
</nav>
|
</nav>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Main Content Area */}
|
{/* Main Content Area */}
|
||||||
<main className="flex-1 bg-slate-50/50 dark:bg-slate-950 h-full flex flex-col transition-colors duration-300 overflow-y-hidden">
|
<main className="flex-1 bg-background/50 h-full flex flex-col transition-colors duration-300 overflow-y-hidden">
|
||||||
<div className="flex-1 flex flex-col max-w-4xl w-full mx-auto p-6 md:p-10 overflow-hidden">
|
<div className="flex-1 flex flex-col max-w-4xl w-full mx-auto p-6 md:p-10 overflow-hidden">
|
||||||
<div className="flex-none flex items-center justify-between mb-6">
|
<div className="flex-none flex items-center justify-between mb-6">
|
||||||
<div>
|
<div>
|
||||||
<h2 className="text-2xl font-bold text-slate-900 dark:text-white">
|
<h2 className="text-2xl font-bold text-foreground">
|
||||||
{activeTab === 'general' && 'General Settings'}
|
{activeTab === 'general' && 'General Settings'}
|
||||||
{activeTab === 'transcode' && 'Media Processing'}
|
{activeTab === 'transcode' && 'Media Processing'}
|
||||||
{activeTab === 'skills' && 'Skills Management'}
|
{activeTab === 'skills' && 'Skills Management'}
|
||||||
@@ -244,7 +244,7 @@ function TeamSettingsPage() {
|
|||||||
{activeTab === 'sandbox' && 'Agent Sandbox Settings'}
|
{activeTab === 'sandbox' && 'Agent Sandbox Settings'}
|
||||||
{activeTab === 'notifications' && 'Notification Settings'}
|
{activeTab === 'notifications' && 'Notification Settings'}
|
||||||
</h2>
|
</h2>
|
||||||
<p className="text-sm text-slate-500 dark:text-slate-400 mt-1">
|
<p className="text-sm text-muted-foreground mt-1">
|
||||||
{activeTab === 'general' && 'View your personal information and team role.'}
|
{activeTab === 'general' && 'View your personal information and team role.'}
|
||||||
{activeTab === 'transcode' &&
|
{activeTab === 'transcode' &&
|
||||||
"Manage your team's media transcoding configurations."}
|
"Manage your team's media transcoding configurations."}
|
||||||
|
|||||||
Reference in New Issue
Block a user