mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-03-04 06:33:45 +00:00
fix: fix cameraNameLabel visually
This commit is contained in:
parent
c7c03a64bc
commit
7f655cc77d
@ -1,18 +1,10 @@
|
||||
import * as React from "react";
|
||||
import * as LabelPrimitive from "@radix-ui/react-label";
|
||||
import { cva, type VariantProps } from "class-variance-authority";
|
||||
|
||||
import { cn } from "@/lib/utils";
|
||||
import { useCameraNickname } from "@/hooks/use-camera-nickname";
|
||||
import { CameraConfig } from "@/types/frigateConfig";
|
||||
|
||||
const labelVariants = cva(
|
||||
"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",
|
||||
);
|
||||
|
||||
interface CameraNameLabelProps
|
||||
extends React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root>,
|
||||
VariantProps<typeof labelVariants> {
|
||||
extends React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root> {
|
||||
camera?: string | CameraConfig;
|
||||
}
|
||||
|
||||
@ -22,11 +14,7 @@ const CameraNameLabel = React.forwardRef<
|
||||
>(({ className, camera, ...props }, ref) => {
|
||||
const displayName = useCameraNickname(camera);
|
||||
return (
|
||||
<LabelPrimitive.Root
|
||||
ref={ref}
|
||||
className={cn(labelVariants(), className)}
|
||||
{...props}
|
||||
>
|
||||
<LabelPrimitive.Root ref={ref} className={className} {...props}>
|
||||
{displayName}
|
||||
</LabelPrimitive.Root>
|
||||
);
|
||||
|
||||
@ -20,7 +20,7 @@ export default function FilterSwitch({
|
||||
<div className="flex items-center justify-between gap-1">
|
||||
{isCameraName ? (
|
||||
<CameraNameLabel
|
||||
className={`mx-2 w-full cursor-pointer text-primary smart-capitalize ${disabled ? "text-secondary-foreground" : ""}`}
|
||||
className={`mx-2 w-full cursor-pointer text-sm font-medium leading-none text-primary smart-capitalize peer-disabled:cursor-not-allowed peer-disabled:opacity-70 ${disabled ? "text-secondary-foreground" : ""}`}
|
||||
htmlFor={label}
|
||||
camera={label}
|
||||
/>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user