mirror of
https://github.com/aykhans/slash-e.git
synced 2025-04-21 22:28:57 +00:00
chore: add empty view
This commit is contained in:
parent
691b40c968
commit
d46df916cf
@ -29,7 +29,7 @@ const ShortcutView = (props: Props) => {
|
||||
const handleDeleteShortcutButtonClick = (shortcut: Shortcut) => {
|
||||
showCommonDialog({
|
||||
title: "Delete Shortcut",
|
||||
content: `Are you sure to delete shortcut \`${shortcut.name}\` in this workspace?`,
|
||||
content: `Are you sure to delete shortcut \`${shortcut.name}\`? You can not undo this action.`,
|
||||
style: "danger",
|
||||
onConfirm: async () => {
|
||||
await shortcutService.deleteShortcutById(shortcut.id);
|
||||
|
@ -1,3 +1,4 @@
|
||||
import { Button } from "@mui/joy";
|
||||
import { useEffect, useState } from "react";
|
||||
import { shortcutService } from "../services";
|
||||
import { useAppSelector } from "../stores";
|
||||
@ -59,10 +60,18 @@ const Home: React.FC = () => {
|
||||
</div>
|
||||
</div>
|
||||
{loadingState.isLoading ? (
|
||||
<div className="py-4 w-full flex flex-row justify-center items-center">
|
||||
<div className="py-12 w-full flex flex-row justify-center items-center opacity-80">
|
||||
<Icon.Loader className="mr-2 w-5 h-auto animate-spin" />
|
||||
loading
|
||||
</div>
|
||||
) : shortcutList.length === 0 ? (
|
||||
<div className="py-4 w-full flex flex-col justify-center items-center">
|
||||
<Icon.PackageOpen className="w-12 h-auto text-gray-400" />
|
||||
<p className="mt-4 mb-2">No shortcuts found.</p>
|
||||
<Button size="sm" onClick={() => setShowCreateShortcutDialog(true)}>
|
||||
Create one
|
||||
</Button>
|
||||
</div>
|
||||
) : (
|
||||
<ShortcutListView shortcutList={shortcutList} />
|
||||
)}
|
||||
|
Loading…
x
Reference in New Issue
Block a user