From 53b32285191fb31bdd9c555aef000202a98bb928 Mon Sep 17 00:00:00 2001 From: Niels van Velzen Date: Tue, 25 Feb 2025 22:48:15 +0100 Subject: [PATCH] Use Paper component --- src/apps/dashboard/routes/logs/file.tsx | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/src/apps/dashboard/routes/logs/file.tsx b/src/apps/dashboard/routes/logs/file.tsx index 24caf4c06b..7eab74be8a 100644 --- a/src/apps/dashboard/routes/logs/file.tsx +++ b/src/apps/dashboard/routes/logs/file.tsx @@ -7,13 +7,13 @@ import Alert from '@mui/material/Alert'; import Box from '@mui/material/Box'; import Button from '@mui/material/Button'; import ButtonGroup from '@mui/material/ButtonGroup'; -import Card from '@mui/material/Card'; -import CardContent from '@mui/material/CardContent'; import Container from '@mui/material/Container'; +import Paper from '@mui/material/Paper'; import Typography from '@mui/material/Typography'; import { ContentCopy, FileDownload } from '@mui/icons-material'; import globalize from 'lib/globalize'; import toast from 'components/toast/toast'; +import { copy } from 'scripts/clipboard'; export const Component = () => { const { file: fileName } = useParams(); @@ -27,8 +27,8 @@ export const Component = () => { const retry = useCallback(() => refetch(), [refetch]); const copyToClipboard = useCallback(async () => { - if ('clipboard' in navigator && log) { - await navigator.clipboard.writeText(log); + if (log) { + await copy(log); toast({ text: globalize.translate('CopyLogSuccess') }); } }, [log]); @@ -94,13 +94,11 @@ export const Component = () => { - - - -
{log}
-
-
-
+ + +
{log}
+
+
)}