- {(
- [
- {
- label: "새로고침",
- onClick: () => {
- timeline.refresh();
- setMenuOpen(false);
- },
- disabled: !account || timeline.loading
- },
- {
- label: "원본 서버에서 보기",
- onClick: handleOpenInstanceOrigin,
- disabled: !instanceOriginUrl
- },
- {
- label: "섹션 설정",
- onClick: () => {
- setMenuOpen(false);
- setSettingsOpen(true);
- },
- disabled: false
- },
- {
- type: "divider"
- },
- {
- label: "왼쪽 섹션 추가",
- onClick: () => {
- onAddSectionLeft(section.id);
- setMenuOpen(false);
- },
- disabled: false
- },
- {
- label: "왼쪽으로 이동",
- onClick: () => {
- onMoveSection(section.id, "left");
- setMenuOpen(false);
- },
- disabled: !canMoveLeft
- },
- {
- label: "오른쪽으로 이동",
- onClick: () => {
- onMoveSection(section.id, "right");
- setMenuOpen(false);
- },
- disabled: !canMoveRight
- },
- {
- label: "오른쪽 섹션 추가",
- onClick: () => {
- onAddSectionRight(section.id);
- setMenuOpen(false);
- },
- disabled: false
- },
- {
- label: "섹션 삭제",
- onClick: () => {
- onRemoveSection(section.id);
- setMenuOpen(false);
- },
- disabled: !canRemoveSection,
- danger: true
- }
- ]
- ).map((item, index) => {
+ {sectionMenuItems.map((item, index) => {
if ("type" in item && item.type === "divider") {
- return
;
+ return
;
}
- const icon = (() => {
- switch (item.label) {
- case "새로고침":
- return (
-
- );
- case "원본 서버에서 보기":
- return (
-
- );
- case "섹션 설정":
- return (
-
- );
- case "왼쪽 섹션 추가":
- return null;
- case "왼쪽으로 이동":
- return null;
- case "오른쪽으로 이동":
- return null;
- case "오른쪽 섹션 추가":
- return null;
- case "섹션 삭제":
- return null;
- default:
- return null;
- }
- })();
const className = [
item.danger ? "danger" : "",
highlightedSectionMenuIndex === index ? "is-highlighted" : ""
@@ -1105,19 +1114,19 @@ export const TimelineSection = ({
.join(" ");
return (