2025-11-02 02:46:20 +09:00
|
|
|
import Link from "next/link";
|
2025-10-09 14:52:52 +09:00
|
|
|
"use client";
|
|
|
|
|
import { usePermission } from "@/lib/usePermission";
|
|
|
|
|
|
|
|
|
|
export function QuickActions() {
|
|
|
|
|
const { can } = usePermission();
|
|
|
|
|
const canWrite = can("POST", "CREATE");
|
|
|
|
|
const isAdmin = can("ADMIN", "ADMINISTER") || can("BOARD", "MODERATE");
|
|
|
|
|
return (
|
|
|
|
|
<div style={{ display: "flex", gap: 8 }}>
|
2025-11-02 02:46:20 +09:00
|
|
|
{canWrite && <Link href="/posts/new"><button>글쓰기</button></Link>}
|
|
|
|
|
{isAdmin && <Link href="/admin"><button>관리자</button></Link>}
|
2025-10-09 14:52:52 +09:00
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|