mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-10 21:25:24 +03:00
optimistic reviewed switch
This commit is contained in:
parent
9ae1021009
commit
902957448a
@ -362,13 +362,19 @@ function ShowReviewFilter({
|
|||||||
showReviewed,
|
showReviewed,
|
||||||
setShowReviewed,
|
setShowReviewed,
|
||||||
}: ShowReviewedFilterProps) {
|
}: ShowReviewedFilterProps) {
|
||||||
|
const [showReviewedSwitch, setShowReviewedSwitch] = useOptimisticState(
|
||||||
|
showReviewed,
|
||||||
|
setShowReviewed,
|
||||||
|
);
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<div className="hidden h-9 md:flex p-2 justify-start items-center text-sm bg-secondary hover:bg-secondary/80 text-secondary-foreground rounded-md cursor-pointer">
|
<div className="hidden h-9 md:flex p-2 justify-start items-center text-sm bg-secondary hover:bg-secondary/80 text-secondary-foreground rounded-md cursor-pointer">
|
||||||
<Switch
|
<Switch
|
||||||
id="reviewed"
|
id="reviewed"
|
||||||
checked={showReviewed == 1}
|
checked={showReviewedSwitch == 1}
|
||||||
onCheckedChange={() => setShowReviewed(showReviewed == 0 ? 1 : 0)}
|
onCheckedChange={() =>
|
||||||
|
setShowReviewedSwitch(showReviewedSwitch == 0 ? 1 : 0)
|
||||||
|
}
|
||||||
/>
|
/>
|
||||||
<Label className="ml-2 cursor-pointer" htmlFor="reviewed">
|
<Label className="ml-2 cursor-pointer" htmlFor="reviewed">
|
||||||
Show Reviewed
|
Show Reviewed
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user