import { SvgIcon, type SvgIconProps } from '@mui/material'
import { ArticleOutlined, ImageOutlined } from '@mui/icons-material'

/**
 * Generic "image" glyph used for the PNG download item. Wraps MUI's
 * `ImageOutlined` so callers can swap it via the per-widget download
 * config's `icon` override without pulling MUI directly.
 */
export function PNGIcon(props: SvgIconProps) {
  return <ImageOutlined {...props} />
}

/**
 * Generic "document" glyph used for the Markdown download item. Wraps MUI's
 * `ArticleOutlined`, mirroring {@link PNGIcon}, so the Markdown menu item
 * carries an icon consistent with the other download formats.
 */
export function MarkdownIcon(props: SvgIconProps) {
  return <ArticleOutlined {...props} />
}

/**
 * "CSV" rectangle with the letters spelled inside — matches v1 visual and is
 * easier to recognise in a download menu than a generic table glyph.
 */
export function CSVIcon(props: SvgIconProps) {
  return (
    <SvgIcon viewBox='0 0 18 18' {...props}>
      <path
        fill='currentColor'
        d='M4.313 11.25h2.25v-1.125H4.688v-2.25h1.875V6.75h-2.25a.726.726 0 0 0-.535.216.726.726 0 0 0-.216.534v3c0 .213.072.39.216.534a.726.726 0 0 0 .534.216Zm2.925 0h2.25c.212 0 .39-.072.534-.216a.726.726 0 0 0 .216-.534V9.375a.931.931 0 0 0-.216-.59.658.658 0 0 0-.534-.273H8.363v-.637h1.875V6.75h-2.25a.726.726 0 0 0-.535.216.726.726 0 0 0-.216.534v1.125c0 .213.072.403.216.572a.675.675 0 0 0 .534.253h1.126v.675H7.238v1.125Zm4.95 0h1.124l1.313-4.5H13.5l-.75 2.588L12 6.75h-1.125l1.313 4.5ZM3 15c-.413 0-.766-.147-1.06-.44a1.445 1.445 0 0 1-.44-1.06v-9c0-.412.147-.766.44-1.06C2.235 3.148 2.588 3 3 3h12c.412 0 .766.147 1.06.44.293.294.44.648.44 1.06v9c0 .412-.147.766-.44 1.06-.294.293-.647.44-1.06.44H3Zm0-1.5h12v-9H3v9Z'
      />
    </SvgIcon>
  )
}
