import Link from "next/link";
"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 }}>
      {canWrite && <Link href="/posts/new"><button>글쓰기</button></Link>}
      {isAdmin && <Link href="/admin"><button>관리자</button></Link>}
    </div>
  );
}


