forked from TabbyML/tabby
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(ui, webserver): allow deactivating a user (TabbyML#1319)
* feat(ui): users pagination * feat(ui): simple pagination * feat(ui): pagination * feat(ui): updateUserActive * [autofix.ci] apply automated fixes * fix(ui): display status badge * fix(ui): add toast * fix(ui): add error toast * fix(ui): format --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
- Loading branch information
1 parent
cb50aea
commit 6399606
Showing
9 changed files
with
299 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import React from 'react' | ||
|
||
import { cn } from '@/lib/utils' | ||
|
||
import { Button } from './ui/button' | ||
import { IconChevronRight } from './ui/icons' | ||
|
||
interface SimplePagination extends React.HTMLAttributes<HTMLDivElement> { | ||
hasPreviousPage: boolean | undefined | ||
hasNextPage: boolean | undefined | ||
onNext: () => void | ||
onPrev: () => void | ||
} | ||
const SimplePagination: React.FC<SimplePagination> = ({ | ||
className, | ||
hasPreviousPage, | ||
hasNextPage, | ||
onNext, | ||
onPrev | ||
}) => { | ||
return ( | ||
<div className={cn('flex items-center gap-2', className)}> | ||
<Button disabled={!hasPreviousPage} onClick={onPrev}> | ||
<IconChevronRight className="rotate-180" />{' '} | ||
</Button> | ||
<Button disabled={!hasNextPage} onClick={onNext}> | ||
<IconChevronRight />{' '} | ||
</Button> | ||
</div> | ||
) | ||
} | ||
|
||
export { SimplePagination } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.