'use client';
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import { cn } from '@/lib/utils';
import { DownloadSimple, FileAudio, FilePdf } from '@phosphor-icons/react';
export function PDF({ src, title, height = 500, className }) {
    return /*#__PURE__*/ _jsxs("div", {
        className: cn('my-4', className),
        children: [
            title && /*#__PURE__*/ _jsxs("div", {
                className: "flex items-center gap-2 mb-2",
                children: [
                    /*#__PURE__*/ _jsx(FilePdf, {
                        className: "h-5 w-5 text-red-500",
                        weight: "fill"
                    }),
                    /*#__PURE__*/ _jsx("span", {
                        className: "text-sm font-medium",
                        children: title
                    })
                ]
            }),
            /*#__PURE__*/ _jsx("div", {
                className: "rounded-lg border border-border overflow-hidden bg-muted",
                style: {
                    height
                },
                children: /*#__PURE__*/ _jsx("iframe", {
                    src: `${src}#view=FitH`,
                    className: "w-full h-full",
                    title: title || 'PDF Document'
                })
            })
        ]
    });
}
export function Audio({ src, title, autoplay = false, loop = false, className }) {
    return /*#__PURE__*/ _jsxs("div", {
        className: cn('my-4', className),
        children: [
            title && /*#__PURE__*/ _jsxs("div", {
                className: "flex items-center gap-2 mb-2",
                children: [
                    /*#__PURE__*/ _jsx(FileAudio, {
                        className: "h-5 w-5 text-primary",
                        weight: "fill"
                    }),
                    /*#__PURE__*/ _jsx("span", {
                        className: "text-sm font-medium",
                        children: title
                    })
                ]
            }),
            /*#__PURE__*/ _jsx("div", {
                className: "rounded-lg border border-border bg-muted p-4",
                children: /*#__PURE__*/ _jsx("audio", {
                    src: src,
                    controls: true,
                    autoPlay: autoplay,
                    loop: loop,
                    className: "w-full",
                    children: "Your browser does not support the audio element."
                })
            })
        ]
    });
}
export function Download({ src, label, filename, className }) {
    const displayLabel = label || 'Download File';
    const downloadName = filename || src.split('/').pop() || 'download';
    return /*#__PURE__*/ _jsxs("a", {
        href: src,
        download: downloadName,
        className: cn('inline-flex items-center gap-2 px-4 py-2 rounded-lg', 'bg-primary text-primary-foreground hover:bg-primary/90', 'text-sm font-medium transition-colors', 'no-underline', className),
        children: [
            /*#__PURE__*/ _jsx(DownloadSimple, {
                className: "h-4 w-4",
                weight: "bold"
            }),
            displayLabel
        ]
    });
}
