Files
outline/app/hooks/useShareMenuActions.tsx
T
Tom Moor 2206588aa8 feat: Expiry column and expiry menu for shared links (#14579)
* feat: Expiry column and expiry menu for shared links

Adds an Expires column to the shared links table and a Set expiry submenu
with presets, a custom date dialog and removal. Also loads document
memberships in shares.list so the update policy is correct.

* fix: Hide share expiry menu when workspace sharing is disabled

* refactor: Load share document memberships in the list query
2026-11-13 09:29:30 -05:00

31 lines
693 B
TypeScript

import { useMemo } from "react";
import { ActionSeparator } from "~/actions";
import {
copyShareUrl,
goToShareSource,
revokeShare,
setShareExpiry,
} from "~/actions/definitions/shares";
import { useMenuAction } from "~/hooks/useMenuAction";
/**
* Hook that constructs the action menu for share management operations. The
* share is read from the active models in the action context.
*
* @returns action with children for use in menus.
*/
export function useShareMenuActions() {
const actions = useMemo(
() => [
copyShareUrl,
goToShareSource,
setShareExpiry,
ActionSeparator,
revokeShare,
],
[]
);
return useMenuAction(actions);
}