feat: add loader on Socket ID label

main
Justin Xiao 2023-07-21 18:21:53 +08:00
parent 419af7a9d5
commit 632acd2cb0
1 changed files with 5 additions and 1 deletions

View File

@ -13,6 +13,7 @@ import {
Center, Center,
Box, Box,
TextInput, TextInput,
Loader,
} from "@mantine/core"; } from "@mantine/core";
import { import {
IconPlug, IconPlug,
@ -78,7 +79,8 @@ const ChatroomTitle: FC<Props> = ({ targetSocketId, setTargetSocketId }) => {
<Popover.Dropdown> <Popover.Dropdown>
<Group position="apart"> <Group position="apart">
<Text size="sm">SocketID</Text> <Text size="sm">SocketID</Text>
{socket?.id && (
{socket?.id ? (
<CopyButton value={socket.id} timeout={2000}> <CopyButton value={socket.id} timeout={2000}>
{({ copied, copy }) => ( {({ copied, copy }) => (
<Tooltip <Tooltip
@ -99,6 +101,8 @@ const ChatroomTitle: FC<Props> = ({ targetSocketId, setTargetSocketId }) => {
</Tooltip> </Tooltip>
)} )}
</CopyButton> </CopyButton>
) : (
<Loader size="1em" color="blue" />
)} )}
</Group> </Group>
<Group position="apart"> <Group position="apart">