File size: 1,343 Bytes
f0743f4
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
import { memo } from 'react';
import { Button, ThemeSelector } from '@librechat/client';
import { useLocalize } from '~/hooks';

function PanelNavigation({
  onPrevious,
  onNext,
  hasNextPage,
  hasPreviousPage,
  isLoading,
  isChatRoute,
  children,
}: {
  onPrevious: () => void;
  onNext: () => void;
  hasNextPage: boolean;
  hasPreviousPage: boolean;
  isLoading?: boolean;
  isChatRoute: boolean;
  children?: React.ReactNode;
}) {
  const localize = useLocalize();

  return (
    <div className="flex items-center justify-between">
      <div className="flex gap-2">
        {!isChatRoute && <ThemeSelector returnThemeOnly={true} />}
        {children}
      </div>
      <div className="flex items-center gap-2" role="navigation" aria-label="Pagination">
        <Button
          variant="outline"
          size="sm"
          onClick={onPrevious}
          disabled={!hasPreviousPage || isLoading}
          aria-label={localize('com_ui_prev')}
        >
          {localize('com_ui_prev')}
        </Button>
        <Button
          variant="outline"
          size="sm"
          onClick={onNext}
          disabled={!hasNextPage || isLoading}
          aria-label={localize('com_ui_next')}
        >
          {localize('com_ui_next')}
        </Button>
      </div>
    </div>
  );
}

export default memo(PanelNavigation);