김재형

Add actions for folder

import React, { useState } from "react";
import React, { useState, Fragment } from "react";
import { Popconfirm, Popover, Button, message } from "antd";
import { FileItem } from "./useFileList";
import styles from "./FileItemActions.module.scss";
......@@ -52,9 +52,11 @@ export function FileItemActions({
이름 변경
</Button>
</Popover>
{!item.is_folder && (
<Button type="link" size="small">
공유
</Button>
)}
<Popover
title="이동할 폴더를 선택하세요"
content={
......@@ -78,6 +80,7 @@ export function FileItemActions({
이동
</Button>
</Popover>
{!item.is_folder && (
<Popover
title="복사할 폴더를 선택하세요"
content={
......@@ -98,6 +101,8 @@ export function FileItemActions({
복사
</Button>
</Popover>
)}
{!item.is_folder && (
<Popconfirm
title="정말로 삭제하시겠습니까?"
onConfirm={() => onDelete(item.id)}
......@@ -108,6 +113,7 @@ export function FileItemActions({
삭제
</Button>
</Popconfirm>
)}
</div>
);
}
......
......@@ -152,15 +152,14 @@ function getColumns({
dataIndex: "size",
width: 120,
render: (bytes: number, item) =>
item.is_folder ? "" : filesize(bytes, { round: 0 }),
item.is_folder ? "-" : filesize(bytes, { round: 0 }),
},
{
title: "",
key: "action",
dataIndex: "",
width: 300,
render: (__: any, item) =>
item.is_folder ? null : (
render: (__: any, item) => (
<FileItemActions
item={item}
onRename={handleRename}
......