init: sudah ganti logo, hilangin setting, dan investigational use dialog

This commit is contained in:
one
2025-03-06 11:32:45 +07:00
commit 8f31d4ed41
2857 changed files with 355646 additions and 0 deletions

View File

@@ -0,0 +1,55 @@
import React, { ReactNode } from 'react';
import { Button } from '../Button';
import { Icons } from '../Icons';
interface ClipboardProps {
children: ReactNode;
}
const Clipboard: React.FC<ClipboardProps> = ({ children }) => {
const [copyState, setCopyState] = React.useState<'idle' | 'success' | 'error'>('idle');
const copyText = React.useMemo(() => {
if (typeof children === 'string') {
return children.trim();
}
return '';
}, [children]);
const handleCopy = React.useCallback(async () => {
if (!copyText) {
return;
}
try {
await navigator.clipboard.writeText(copyText);
setCopyState('success');
} catch {
setCopyState('error');
} finally {
setTimeout(() => setCopyState('idle'), 1500); // Reset state after feedback
}
}, [copyText]);
return (
<Button
variant="ghost"
size="icon"
onClick={e => {
e.stopPropagation();
handleCopy();
}}
className="text-white"
title="Copy"
>
{copyState === 'idle' && <Icons.Copy className="h-6 w-6" />}
{copyState === 'success' && <Icons.FeedbackComplete className="h-6 w-6 text-white" />}
{copyState === 'error' && (
<Icons.ByName
name="Error"
className="h-6 w-6 text-white"
/>
)}
</Button>
);
};
export { Clipboard };