mirror of
https://github.com/jamiepine/voicebox.git
synced 2026-09-17 22:00:40 -07:00
Refactor App layout and introduce new components for improved organization
- Replaced the main layout in App component with AppFrame for better structure. - Introduced MainEditor component to encapsulate the main editing interface, including ProfileList and HistoryTable. - Added ModelsTab component to manage model-related functionalities. - Updated Sidebar to include a new Models tab for navigation. - Removed unused components and streamlined the layout for enhanced user experience.
This commit is contained in:
@@ -33,7 +33,7 @@ import { usePlayerStore } from '@/stores/playerStore';
|
||||
|
||||
// NEW ALTERNATE HISTORY VIEW - FIXED HEIGHT ROWS
|
||||
export function HistoryTable() {
|
||||
const [page, setPage] = useState(0);
|
||||
const [page, _setPage] = useState(0);
|
||||
const [isScrolled, setIsScrolled] = useState(false);
|
||||
const scrollRef = useRef<HTMLDivElement>(null);
|
||||
const fileInputRef = useRef<HTMLInputElement>(null);
|
||||
@@ -143,7 +143,7 @@ export function HistoryTable() {
|
||||
|
||||
const history = historyData?.items || [];
|
||||
const total = historyData?.total || 0;
|
||||
const hasMore = history.length === limit && (page + 1) * limit < total;
|
||||
const _hasMore = history.length === limit && (page + 1) * limit < total;
|
||||
|
||||
return (
|
||||
<div className="flex flex-col h-full min-h-0 relative">
|
||||
@@ -176,8 +176,8 @@ export function HistoryTable() {
|
||||
<div
|
||||
ref={scrollRef}
|
||||
className={cn(
|
||||
'flex-1 min-h-0 overflow-y-auto space-y-2',
|
||||
isPlayerVisible && 'max-h-[calc(100vh-117px)]',
|
||||
'flex-1 min-h-0 overflow-y-auto space-y-2 pb-4',
|
||||
isPlayerVisible && 'pb-32',
|
||||
)}
|
||||
>
|
||||
{history.map((gen) => {
|
||||
@@ -242,7 +242,9 @@ export function HistoryTable() {
|
||||
</Button>
|
||||
</DropdownMenuTrigger>
|
||||
<DropdownMenuContent align="end">
|
||||
<DropdownMenuItem onClick={() => handlePlay(gen.id, gen.text, gen.profile_id)}>
|
||||
<DropdownMenuItem
|
||||
onClick={() => handlePlay(gen.id, gen.text, gen.profile_id)}
|
||||
>
|
||||
<Play className="mr-2 h-4 w-4" />
|
||||
Play
|
||||
</DropdownMenuItem>
|
||||
@@ -275,24 +277,6 @@ export function HistoryTable() {
|
||||
);
|
||||
})}
|
||||
</div>
|
||||
|
||||
{(total > limit || page > 0) && (
|
||||
<div className="flex justify-between items-center mt-4 shrink-0">
|
||||
<Button
|
||||
variant="outline"
|
||||
onClick={() => setPage((p) => Math.max(0, p - 1))}
|
||||
disabled={page === 0}
|
||||
>
|
||||
Previous
|
||||
</Button>
|
||||
<div className="text-sm text-muted-foreground">
|
||||
Page {page + 1} • {total} total
|
||||
</div>
|
||||
<Button variant="outline" onClick={() => setPage((p) => p + 1)} disabled={!hasMore}>
|
||||
Next
|
||||
</Button>
|
||||
</div>
|
||||
)}
|
||||
</>
|
||||
)}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user