Files
hoanghapc_nextJs/src/components/shared/FancyboxWrapper.tsx
2026-01-30 17:09:41 +07:00

19 lines
420 B
TypeScript

'use client';
import { useEffect } from 'react';
import { Fancybox as NativeFancybox } from '@fancyapps/ui';
export default function FancyboxWrapper({ children }: { children: React.ReactNode }) {
useEffect(() => {
NativeFancybox.bind('[data-fancybox]', {
// Options
});
return () => {
NativeFancybox.destroy();
};
}, []);
return <>{children}</>;
}