MCPcopy Create free account
hub / github.com/Openpanel-dev/openpanel / WithLabel

Function WithLabel

apps/start/src/components/forms/input-with-label.tsx:17–55  ·  view source on GitHub ↗
({
  children,
  className,
  label,
  info,
  error,
}: WithLabel)

Source from the content-addressed store, hash-verified

15type InputWithLabelProps = InputProps & Omit<WithLabel, 'children'>;
16
17export const WithLabel = ({
18 children,
19 className,
20 label,
21 info,
22 error,
23}: WithLabel) => {
24 return (
25 <div className={className}>
26 <div className="mb-2 flex items-end justify-between">
27 <Label
28 className="mb-0 flex flex-1 shrink-0 items-center gap-1 whitespace-nowrap"
29 htmlFor={label}
30 >
31 {label}
32 {info && (
33 <Tooltiper content={info}>
34 <InfoIcon size={14} />
35 </Tooltiper>
36 )}
37 </Label>
38 {error && (
39 <Tooltiper
40 align="end"
41 asChild
42 content={error}
43 tooltipClassName="max-w-80 leading-normal"
44 >
45 <div className="flex items-center gap-1 text-destructive leading-none">
46 Issues
47 <BanIcon size={14} />
48 </div>
49 </Tooltiper>
50 )}
51 </div>
52 {children}
53 </div>
54 );
55};
56
57export const InputWithLabel = forwardRef<HTMLInputElement, InputWithLabelProps>(
58 (props, ref) => {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected