-
Notifications
You must be signed in to change notification settings - Fork 327
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Migrate Network Config Modal from chakra to shadcn/tailwind
- Loading branch information
Showing
13 changed files
with
293 additions
and
349 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import { Label } from "@/components/ui/label"; | ||
import { ToolTipLabel } from "@/components/ui/tooltip"; | ||
import { AsteriskIcon, InfoIcon } from "lucide-react"; | ||
|
||
export function FormFieldSetup(props: { | ||
htmlFor: string; | ||
label: string; | ||
errorMessage: React.ReactNode | undefined; | ||
children: React.ReactNode; | ||
tooltip: React.ReactNode | undefined; | ||
isRequired: boolean; | ||
}) { | ||
return ( | ||
<div> | ||
<div className="mb-2 inline-flex gap-1 items-center"> | ||
<Label htmlFor={props.htmlFor}>{props.label}</Label> | ||
|
||
{props.isRequired && ( | ||
<AsteriskIcon className="text-destructive-text size-3.5" /> | ||
)} | ||
|
||
{props.tooltip && ( | ||
<ToolTipLabel label={props.tooltip}> | ||
<InfoIcon className="text-muted-foreground size-3.5" /> | ||
</ToolTipLabel> | ||
)} | ||
</div> | ||
{props.children} | ||
{props.errorMessage && ( | ||
<p className="text-destructive-text text-sm mt-1"> | ||
{props.errorMessage} | ||
</p> | ||
)} | ||
</div> | ||
); | ||
} |
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.