Download web/src/ui/IconTile.tsx from fsanyoto/loopable: direct link, hf CLI and curl.
- Browser
- Download file 1.08 kB
-
https://huggingface.co/spaces/fsanyoto/loopable/resolve/9291c0100f4e7b8da2efcbbf1ebdea72ee1663e7/web/src/ui/IconTile.tsx
- Command line
-
hf download hf://spaces/fsanyoto/loopable@9291c0100f4e7b8da2efcbbf1ebdea72ee1663e7/web/src/ui/IconTile.tsx
-
curl -L -o IconTile.tsx https://huggingface.co/spaces/fsanyoto/loopable/resolve/9291c0100f4e7b8da2efcbbf1ebdea72ee1663e7/web/src/ui/IconTile.tsx
1.08 kB
| import type { ReactNode } from "react"; | |
| import type { FolderIcon } from "../customer-grid/types"; | |
| import { dbChipClass } from "../shell/nav"; | |
| import "../styles/sdlc80/icon-tile.css"; | |
| export type IconTileSurface = "home" | "home-card" | "starred" | "rail" | "template"; | |
| /** `chip` is the filled database chip, `tint` the light app chip, `none` paints no background. */ | |
| export type IconTileFill = "chip" | "tint" | "none"; | |
| /** Object tiles share their frame; each surface owns one size token and each call its fill. */ | |
| export function IconTile({ children, icon, surface = "home", fill = "none" }: { | |
| children: ReactNode; | |
| icon?: FolderIcon; | |
| surface?: IconTileSurface; | |
| fill?: IconTileFill; | |
| }) { | |
| // `tint` reuses the app chip class so the tile keeps that chip's background and ink. | |
| const fillClass = fill === "chip" ? dbChipClass(icon) + " " : fill === "tint" ? "home-app-glyph " : ""; | |
| return <span className={fillClass + "lp-icon-tile lp-icon-tile--" + surface} | |
| data-icon-tile={surface} aria-hidden="true"> | |
| {children} | |
| </span>; | |
| } | |
| export default IconTile; | |