MCPcopy
hub / github.com/MauriceNino/dashdot / getPart

Function getPart

apps/docs/components/widget-preview.tsx:21–30  ·  view source on GitHub ↗
(
  name: string,
  value: string | number | boolean | null,
)

Source from the content-addressed store, hash-verified

19import { InputGroup, InputGroupAddon, InputGroupInput, InputGroupText } from './ui/input-group';
20
21const getPart = (
22 name: string,
23 value: string | number | boolean | null,
24): string => {
25 if (typeof value === 'boolean') {
26 return value === true ? `&${name}=true` : '';
27 }
28
29 return value !== '' && value != null ? `&${name}=${value.toString()}` : '';
30};
31
32export const WidgetPreview = () => {
33 const [mounted, setMounted] = useState(false);

Callers 1

WidgetPreviewFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected