// Copyright (c) Meta Platforms, Inc. and affiliates. 'use client'; import {useTruncation} from '@astryxdesign/core/Text'; import {Tooltip} from '@astryxdesign/core/Tooltip'; import { Table, TableBody, TableCell, TableHeader, TableHeaderCell, TableRow, } from '@astryxdesign/core/Table'; interface FileAsset { name: string; path: string; mode: 'single' | 'clamped' | 'short'; } const FILES: FileAsset[] = [ { name: 'build', path: 'artifacts/release/build-20261103-120344/index.html', mode: 'single', }, { name: 'bundle', path: 'reports/coverage/packages/core/src/components/Calendar/index.html', mode: 'clamped', }, { name: 'readme', path: 'README.md', mode: 'short', }, ]; function TruncatedCell({children}: {children: string}) { const truncation = useTruncation({maxLines: 1}); return ( {children} ); } function ClampedCell({children}: {children: string}) { const truncation = useTruncation({maxLines: 2}); return ( {children} ); } export default function UseTruncationHookUsage() { return ( Asset Path {FILES.map(file => ( {file.name} {file.mode === 'clamped' ? ( {file.path} ) : ( {file.path} )} ))}
); }