Files
stats/apps/dashboard/src/utils/clipboard.ts
Carl-Gerhard Lindesvärd d31d9924a5 feature(auth): replace clerk.com with custom auth (#103)
* feature(auth): replace clerk.com with custom auth

* minor fixes

* remove notification preferences

* decrease live events interval

fix(api): cookies..

# Conflicts:
#	.gitignore
#	apps/api/src/index.ts
#	apps/dashboard/src/app/providers.tsx
#	packages/trpc/src/trpc.ts
2024-12-20 22:23:07 +01:00

14 lines
321 B
TypeScript

import { toast } from 'sonner';
export function clipboard(value: string | number, description?: null | string) {
navigator.clipboard.writeText(value.toString());
toast(
'Copied to clipboard',
description !== null
? {
description: description ?? value.toString(),
}
: {},
);
}