MCPcopy Create free account
hub / github.com/Snapchat/dagger-browser / GraphSelector

Function GraphSelector

browser/src/components/GraphSelector.tsx:23–46  ·  view source on GitHub ↗
({
  componentName,
  graphs,
  selectGraph
}: Props)

Source from the content-addressed store, hash-verified

21 * If no component is specified `All Components` will be picked
22 */
23export const GraphSelector = ({
24 componentName,
25 graphs,
26 selectGraph
27}: Props) => {
28 let graphOptions = graphs.map(graph => {
29 return { value: graph, label: displayName(graph.toString()) };
30 });
31
32 let defaultValue = componentName
33 ? ({ value: componentName, label: displayName(componentName) } as ValueType<OptionTypeBase, false>)
34 : graphOptions[0];
35
36 return (
37 <Select
38 value={defaultValue}
39 className="component-select"
40 classNamePrefix="react-select"
41 onChange={value => selectGraph((value as unknown as { value: string }).value)}
42 placeholder="Select graph..."
43 options={graphOptions}
44 />
45 );
46};

Callers

nothing calls this directly

Calls 1

displayNameFunction · 0.85

Tested by

no test coverage detected