mirror of
https://github.com/MrUnknownDE/panel.git
synced 2026-04-18 22:33:44 +02:00
ui(admin): add CopyOnClick button to NodeConfigurationContainer
This commit is contained in:
@@ -19,7 +19,7 @@ const Toast = styled.div`
|
||||
}
|
||||
`;
|
||||
|
||||
const CopyOnClick: React.FC<{ text: any }> = ({ text, children }) => {
|
||||
const CopyOnClick: React.FC<{ text: any, hideTextInToast?: boolean }> = ({ text, hideTextInToast, children }) => {
|
||||
const [ copied, setCopied ] = useState(false);
|
||||
|
||||
useEffect(() => {
|
||||
@@ -45,7 +45,11 @@ const CopyOnClick: React.FC<{ text: any }> = ({ text, children }) => {
|
||||
{copied ?
|
||||
<Toast>
|
||||
<div>
|
||||
<p>Copied "{text}" to clipboard.</p>
|
||||
{hideTextInToast ?
|
||||
<p>Copied text to clipboard.</p>
|
||||
:
|
||||
<p>Copied "{text}" to clipboard.</p>
|
||||
}
|
||||
</div>
|
||||
</Toast>
|
||||
:
|
||||
|
||||
Reference in New Issue
Block a user