MCPcopy
hub / github.com/AgentOps-AI/agentops / toast

Function toast

app/dashboard/components/ui/use-toast.ts:140–172  ·  view source on GitHub ↗
({ ...props }: Toast)

Source from the content-addressed store, hash-verified

138type Toast = Omit<ToasterToast, 'id'>;
139
140function toast({ ...props }: Toast) {
141 const id = genId();
142
143 const update = (props: ToasterToast) =>
144 dispatch({
145 type: 'UPDATE_TOAST',
146 toast: {
147 duration: TOAST_DURATION,
148 ...props,
149 id,
150 },
151 });
152 const dismiss = () => dispatch({ type: 'DISMISS_TOAST', toastId: id });
153
154 dispatch({
155 type: 'ADD_TOAST',
156 toast: {
157 duration: TOAST_DURATION,
158 ...props,
159 id,
160 open: true,
161 onOpenChange: (open) => {
162 if (!open) dismiss();
163 },
164 },
165 });
166
167 return {
168 id: id,
169 dismiss,
170 update,
171 };
172}
173
174function useToast() {
175 const [state, setState] = React.useState<State>(memoryState);

Callers 15

handleClickFunction · 0.90
copyToClipboardFunction · 0.90
handleSaveBranchFunction · 0.90
BranchModalFunction · 0.90
copyApiKeyFunction · 0.90
ProjectDetailsFunction · 0.90
createProjectFunction · 0.90
updateProjectInfoFunction · 0.90
handleCopyFunction · 0.90
handleCopyFunction · 0.90
handleCopyFunction · 0.90
handleDownloadFunction · 0.90

Calls 3

genIdFunction · 0.85
dispatchFunction · 0.85
dismissFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…