Update from Vibe Studio

This commit is contained in:
Vibe Studio
2026-01-16 02:20:32 +00:00
parent a4605e311a
commit 71de1506ca
28603 changed files with 2179459 additions and 0 deletions

View File

@@ -0,0 +1,23 @@
import * as React from 'react';
function toArray(val) {
return val ? Array.isArray(val) ? val : [val] : [];
}
export default function useAction(mobile, action, showAction, hideAction) {
return React.useMemo(function () {
var mergedShowAction = toArray(showAction !== null && showAction !== void 0 ? showAction : action);
var mergedHideAction = toArray(hideAction !== null && hideAction !== void 0 ? hideAction : action);
var showActionSet = new Set(mergedShowAction);
var hideActionSet = new Set(mergedHideAction);
if (mobile) {
if (showActionSet.has('hover')) {
showActionSet.delete('hover');
showActionSet.add('click');
}
if (hideActionSet.has('hover')) {
hideActionSet.delete('hover');
hideActionSet.add('click');
}
}
return [showActionSet, hideActionSet];
}, [mobile, action, showAction, hideAction]);
}