openrag/frontend/components/label-wrapper.tsx
Lucas Oliveira e0015f35db
fix: update onboarding design, make opensearch index be initialized after onboarding, make flow reset change the models to the provider chosen (#100)
* changed tooltip stype

* added start on label wrapper

* changed switch to checkbox on openai onboarding and changed copies

* made border be red when api key is invalid

* Added embedding configuration after onboarding

* changed openrag ingest docling to have same embedding model component as other flows

* changed flows service to get flow by id, not by path

* modify reset_langflow to also put right embedding model

* added endpoint and project id to provider config

* added replacing the model with the provider model when resetting

* Moved consts to settings.py

* raise when flow_id is not found
2025-09-26 12:04:17 -03:00

61 lines
1.6 KiB
TypeScript

import { Info } from "lucide-react";
import { cn } from "@/lib/utils";
import { Label } from "./ui/label";
import { Tooltip, TooltipContent, TooltipTrigger } from "./ui/tooltip";
export function LabelWrapper({
label,
description,
helperText,
id,
required,
flex,
start,
children,
}: {
label: string;
description?: string;
helperText?: string | React.ReactNode;
id: string;
required?: boolean;
flex?: boolean;
start?: boolean;
children: React.ReactNode;
}) {
return (
<div
className={cn(
"flex w-full items-center",
start ? "justify-start flex-row-reverse gap-3" : "justify-between",
)}
>
<div
className={cn(
"flex flex-1 flex-col items-start",
flex ? "gap-3" : "gap-2",
)}
>
<Label
htmlFor={id}
className="!text-mmd font-medium flex items-center gap-1.5"
>
{label}
{required && <span className="text-red-500">*</span>}
{helperText && (
<Tooltip>
<TooltipTrigger>
<Info className="w-3.5 h-3.5 text-muted-foreground" />
</TooltipTrigger>
<TooltipContent side="right">{helperText}</TooltipContent>
</Tooltip>
)}
</Label>
{!flex && <div className="relative w-full">{children}</div>}
{description && (
<p className="text-mmd text-muted-foreground">{description}</p>
)}
</div>
{flex && <div className="relative items-center flex">{children}</div>}
</div>
);
}