UNPKG

@lobehub/ui

Version:

Lobe UI is an open-source UI component library for building AIGC web apps

1 lines 2.15 kB
{"version":3,"file":"FolderIcon.mjs","names":["FolderIcon: FC<FolderIconProps>"],"sources":["../../../src/FileTypeIcon/components/FolderIcon.tsx"],"sourcesContent":["import { cssVar, cx } from 'antd-style';\nimport { type FC } from 'react';\n\nimport { SvgProps } from '@/types';\n\nimport { styles } from '../style';\n\ninterface FolderIconProps extends SvgProps {\n filetype?: string;\n fontSize?: number;\n hasIcon?: boolean;\n iconColor?: string;\n isMono?: boolean;\n size?: number;\n}\n\nconst FolderIcon: FC<FolderIconProps> = ({\n size,\n isMono,\n hasIcon,\n iconColor,\n filetype,\n className,\n fontSize,\n style,\n ...rest\n}) => {\n return (\n <svg\n className={cx(styles.icon, !hasIcon && className)}\n height={size}\n style={hasIcon ? undefined : style}\n viewBox=\"0 0 24 24\"\n width={size}\n xmlns=\"http://www.w3.org/2000/svg\"\n {...rest}\n >\n <path\n d=\"M10.46 5.076l-.92-.752A1.446 1.446 0 008.626 4H3.429c-.38 0-.743.147-1.01.41A1.386 1.386 0 002 5.4v13.2c0 .371.15.727.418.99.268.262.632.41 1.01.41h17.143c.38 0 .743-.148 1.01-.41.268-.263.419-.619.419-.99V6.8c0-.371-.15-.727-.418-.99a1.444 1.444 0 00-1.01-.41h-9.198c-.334 0-.657-.115-.914-.324z\"\n fill={iconColor}\n stroke={cssVar.colorFillSecondary}\n strokeWidth={0.5}\n />\n {!hasIcon && filetype && (\n <text\n fill={isMono ? cssVar.colorTextSecondary : '#fff'}\n fontSize={fontSize}\n fontWeight=\"bold\"\n textAnchor=\"middle\"\n x=\"50%\"\n y=\"70%\"\n >\n {filetype.toUpperCase()}\n </text>\n )}\n </svg>\n );\n};\n\nexport default FolderIcon;\n"],"mappings":";;;;;AAgBA,MAAMA,cAAmC,EACvC,MACA,QACA,SACA,WACA,UACA,WACA,UACA,OACA,GAAG,WACC;AACJ,QACE,qBAAC;EACC,WAAW,GAAG,OAAO,MAAM,CAAC,WAAW,UAAU;EACjD,QAAQ;EACR,OAAO,UAAU,SAAY;EAC7B,SAAQ;EACR,OAAO;EACP,OAAM;EACN,GAAI;aAEJ,oBAAC;GACC,GAAE;GACF,MAAM;GACN,QAAQ,OAAO;GACf,aAAa;IACb,EACD,CAAC,WAAW,YACX,oBAAC;GACC,MAAM,SAAS,OAAO,qBAAqB;GACjC;GACV,YAAW;GACX,YAAW;GACX,GAAE;GACF,GAAE;aAED,SAAS,aAAa;IAClB;GAEL;;AAIV,yBAAe"}