MCPcopy Index your code
hub / github.com/coder/coder / addMeAsFirstOption

Function addMeAsFirstOption

site/src/components/Filter/UserFilter.tsx:21–33  ·  view source on GitHub ↗
(options: readonly SelectFilterOption[])

Source from the content-addressed store, hash-verified

19 const { user: me } = useAuthenticated();
20
21 const addMeAsFirstOption = (options: readonly SelectFilterOption[]) => {
22 const filtered = options.filter((o) => o.value !== me.username);
23 return [
24 {
25 label: me.username,
26 value: me.username,
27 startIcon: (
28 <Avatar fallback={me.username} src={me.avatar_url} size="sm" />
29 ),
30 },
31 ...filtered,
32 ];
33 };
34
35 return useFilterMenu({
36 onChange,

Callers 1

useUserFilterMenuFunction · 0.85

Calls 1

filterMethod · 0.80

Tested by

no test coverage detected