import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
// packages/ui/src/internal/layout/components/footer/FooterLegalLinks.tsx
/**
 * @fileoverview FooterLegalLinks Component
 * @description Legal links component for use in sidebars when footer is hidden
 *
 * @version 0.0.1
 * @since 0.0.1
 * @author AMBROISE PARK Consulting
 */
import { Stack } from '@donotdev/components';
import { useTranslation, maybeTranslate, useAppConfig } from '@donotdev/core';
import { FooterBranding } from './FooterBranding';
import { useLegalLinks } from './useLegalLinks';
import { Link } from '../../../../routing/Link';
/**
 * FooterLegalLinks - Legal links component
 *
 * Renders legal links from app.footer.legalLinks config.
 * If app not provided, reads from app config automatically.
 * Used in footer and sidebar when footer zone is hidden.
 *
 * @version 0.0.1
 * @since 0.0.1
 * @author AMBROISE PARK Consulting
 */
export const FooterLegalLinks = ({ app, direction = 'column', gap = 'tight', align = 'stretch', }) => {
    const { t } = useTranslation('dndev');
    const appConfig = useAppConfig('app');
    const resolvedApp = app || appConfig || {};
    const links = useLegalLinks(resolvedApp.footer);
    const linkStyle = {
        transition: 'color var(--dur-fast) ease-out',
        textDecoration: 'underline',
        textUnderlineOffset: '2px',
        color: 'var(--muted-foreground)',
        fontSize: 'var(--font-size-xs)',
    };
    if (links.length === 0) {
        return null;
    }
    return (_jsxs(Stack, { direction: direction, gap: gap, align: align, children: [links.map((link) => (_jsx(Link, { path: link.path, style: linkStyle, onMouseEnter: (e) => (e.currentTarget.style.color = 'var(--primary)'), onMouseLeave: (e) => (e.currentTarget.style.color = 'var(--muted-foreground)'), children: maybeTranslate(t, link.label) }, link.path))), _jsx(FooterBranding, {})] }));
};
export default FooterLegalLinks;
