|
|
@ -1,7 +1,6 @@
|
|
|
|
import { Divider, IconButton, Input, Tooltip } from "@mui/joy";
|
|
|
|
import { Divider, IconButton, Input, Tooltip } from "@mui/joy";
|
|
|
|
import { includes } from "lodash-es";
|
|
|
|
import { includes } from "lodash-es";
|
|
|
|
import { useEffect, useState } from "react";
|
|
|
|
import { useEffect, useState } from "react";
|
|
|
|
import { Link } from "react-router-dom";
|
|
|
|
|
|
|
|
import { showCommonDialog } from "@/components/Dialog/CommonDialog";
|
|
|
|
import { showCommonDialog } from "@/components/Dialog/CommonDialog";
|
|
|
|
import Empty from "@/components/Empty";
|
|
|
|
import Empty from "@/components/Empty";
|
|
|
|
import Icon from "@/components/Icon";
|
|
|
|
import Icon from "@/components/Icon";
|
|
|
@ -10,7 +9,7 @@ import ResourceIcon from "@/components/ResourceIcon";
|
|
|
|
import { resourceServiceClient } from "@/grpcweb";
|
|
|
|
import { resourceServiceClient } from "@/grpcweb";
|
|
|
|
import useLoading from "@/hooks/useLoading";
|
|
|
|
import useLoading from "@/hooks/useLoading";
|
|
|
|
import i18n from "@/i18n";
|
|
|
|
import i18n from "@/i18n";
|
|
|
|
import { extractMemoIdFromName, useMemoStore } from "@/store/v1";
|
|
|
|
import { useMemoStore } from "@/store/v1";
|
|
|
|
import { Resource } from "@/types/proto/api/v1/resource_service";
|
|
|
|
import { Resource } from "@/types/proto/api/v1/resource_service";
|
|
|
|
import { useTranslate } from "@/utils/i18n";
|
|
|
|
import { useTranslate } from "@/utils/i18n";
|
|
|
|
|
|
|
|
|
|
|
@ -118,7 +117,6 @@ const Resources = () => {
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div className="w-full max-w-[calc(100%-4rem)] sm:max-w-[calc(100%-6rem)] flex flex-row justify-start items-start gap-4 flex-wrap">
|
|
|
|
<div className="w-full max-w-[calc(100%-4rem)] sm:max-w-[calc(100%-6rem)] flex flex-row justify-start items-start gap-4 flex-wrap">
|
|
|
|
{resources.map((resource) => {
|
|
|
|
{resources.map((resource) => {
|
|
|
|
const relatedMemo = resource.memo ? memoStore.getMemoByName(resource.memo) : null;
|
|
|
|
|
|
|
|
return (
|
|
|
|
return (
|
|
|
|
<div key={resource.name} className="w-24 sm:w-32 h-auto flex flex-col justify-start items-start">
|
|
|
|
<div key={resource.name} className="w-24 sm:w-32 h-auto flex flex-col justify-start items-start">
|
|
|
|
<div className="w-24 h-24 flex justify-center items-center sm:w-32 sm:h-32 border dark:border-zinc-900 overflow-clip rounded-xl cursor-pointer hover:shadow hover:opacity-80">
|
|
|
|
<div className="w-24 h-24 flex justify-center items-center sm:w-32 sm:h-32 border dark:border-zinc-900 overflow-clip rounded-xl cursor-pointer hover:shadow hover:opacity-80">
|
|
|
@ -126,14 +124,6 @@ const Resources = () => {
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div className="w-full max-w-full flex flex-row justify-between items-center mt-1 px-1">
|
|
|
|
<div className="w-full max-w-full flex flex-row justify-between items-center mt-1 px-1">
|
|
|
|
<p className="text-xs shrink text-gray-400 truncate">{resource.filename}</p>
|
|
|
|
<p className="text-xs shrink text-gray-400 truncate">{resource.filename}</p>
|
|
|
|
{relatedMemo && (
|
|
|
|
|
|
|
|
<Link
|
|
|
|
|
|
|
|
className="shrink-0 text-xs ml-1 text-gray-400 hover:underline hover:text-blue-600"
|
|
|
|
|
|
|
|
to={`/m/${relatedMemo.uid}`}
|
|
|
|
|
|
|
|
>
|
|
|
|
|
|
|
|
#{extractMemoIdFromName(relatedMemo.name)}
|
|
|
|
|
|
|
|
</Link>
|
|
|
|
|
|
|
|
)}
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
);
|
|
|
|