mirror of
https://github.com/aykhans/slash-e.git
synced 2025-04-18 21:19:44 +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) => {
|
const handleDeleteShortcutButtonClick = (shortcut: Shortcut) => {
|
||||||
showCommonDialog({
|
showCommonDialog({
|
||||||
title: "Delete Shortcut",
|
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",
|
style: "danger",
|
||||||
onConfirm: async () => {
|
onConfirm: async () => {
|
||||||
await shortcutService.deleteShortcutById(shortcut.id);
|
await shortcutService.deleteShortcutById(shortcut.id);
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
import { Button } from "@mui/joy";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import { shortcutService } from "../services";
|
import { shortcutService } from "../services";
|
||||||
import { useAppSelector } from "../stores";
|
import { useAppSelector } from "../stores";
|
||||||
@ -59,10 +60,18 @@ const Home: React.FC = () => {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{loadingState.isLoading ? (
|
{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" />
|
<Icon.Loader className="mr-2 w-5 h-auto animate-spin" />
|
||||||
loading
|
loading
|
||||||
</div>
|
</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} />
|
<ShortcutListView shortcutList={shortcutList} />
|
||||||
)}
|
)}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user