- Added a new task store in `src-react/stores/task.ts` to manage tasks and their statuses. - Implemented functions for creating, executing, and retrying tasks, along with handling task progress and completion. - Introduced persistence for tasks using IPC. - Created utility functions for normalizing room types and building subtasks. - Added a new CSS file for global styles in `src-react/styles.css`. - Created runtime types in `src-react/types/runtime.ts` and exported them. - Updated the main entry points for Vue and React applications to support dynamic framework loading. - Refactored chat model interfaces and utility functions into `src/shared/chat-model.ts`. - Updated TypeScript configuration to include paths for React components and types. - Enhanced Vite configuration to support both Vue and React frameworks.
72 lines
2.2 KiB
TypeScript
72 lines
2.2 KiB
TypeScript
type TitleBarProps = {
|
||
variant?: 'default' | 'light';
|
||
};
|
||
|
||
export default function TitleBar({ variant = 'default' }: TitleBarProps) {
|
||
const platform = (window as any).api?.platform ?? '';
|
||
|
||
if (platform === 'linux') return null;
|
||
|
||
const iconColorClass =
|
||
variant === 'light' ? 'text-white' : 'text-[#525866] dark:text-gray-300';
|
||
const borderColorClass =
|
||
variant === 'light' ? 'border-b-white/30' : 'border-b-gray-300 dark:border-gray-700';
|
||
|
||
if (platform === 'darwin') {
|
||
return (
|
||
<div
|
||
className={['drag-region h-10 shrink-0 border-b', borderColorClass].join(' ')}
|
||
style={{ background: 'transparent' }}
|
||
/>
|
||
);
|
||
}
|
||
|
||
return (
|
||
<div
|
||
className={['drag-region flex h-10 shrink-0 items-center justify-end border-b', borderColorClass].join(
|
||
' ',
|
||
)}
|
||
style={{ background: 'transparent' }}
|
||
>
|
||
<div className="no-drag flex h-full">
|
||
<button
|
||
type="button"
|
||
className={['flex h-full w-11 items-center justify-center hover:bg-[#999] hover:text-white transition-colors', iconColorClass].join(
|
||
' ',
|
||
)}
|
||
title="Minimize"
|
||
onClick={() => {
|
||
(window as any).api?.windowMinimize?.();
|
||
}}
|
||
>
|
||
<span className="text-base leading-none">−</span>
|
||
</button>
|
||
<button
|
||
type="button"
|
||
className={['flex h-full w-11 items-center justify-center hover:bg-[#999] hover:text-white transition-colors', iconColorClass].join(
|
||
' ',
|
||
)}
|
||
title="Maximize"
|
||
onClick={() => {
|
||
(window as any).api?.windowMaximize?.();
|
||
}}
|
||
>
|
||
<span className="text-[14px] leading-none">▢</span>
|
||
</button>
|
||
<button
|
||
type="button"
|
||
className={['flex h-full w-11 items-center justify-center hover:bg-[#ff0000] hover:text-white transition-colors', iconColorClass].join(
|
||
' ',
|
||
)}
|
||
title="Close"
|
||
onClick={() => {
|
||
(window as any).api?.windowClose?.();
|
||
}}
|
||
>
|
||
<span className="text-base leading-none">×</span>
|
||
</button>
|
||
</div>
|
||
</div>
|
||
);
|
||
}
|