Buckets:
| import style from "./content-text.module.css" | |
| import { createSignal } from "solid-js" | |
| import { createOverflow, useShareMessages } from "./common" | |
| import { CopyButton } from "./copy-button" | |
| interface Props { | |
| text: string | |
| expand?: boolean | |
| compact?: boolean | |
| } | |
| export function ContentText(props: Props) { | |
| const [expanded, setExpanded] = createSignal(false) | |
| const overflow = createOverflow() | |
| const messages = useShareMessages() | |
| return ( | |
| <div | |
| class={style.root} | |
| data-expanded={expanded() || props.expand === true ? true : undefined} | |
| data-compact={props.compact === true ? true : undefined} | |
| > | |
| <pre data-slot="text" ref={overflow.ref}> | |
| {props.text} | |
| </pre> | |
| {((!props.expand && overflow.status) || expanded()) && ( | |
| <button | |
| type="button" | |
| data-component="text-button" | |
| data-slot="expand-button" | |
| onClick={() => setExpanded((e) => !e)} | |
| > | |
| {expanded() ? messages.show_less : messages.show_more} | |
| </button> | |
| )} | |
| <CopyButton text={props.text} /> | |
| </div> | |
| ) | |
| } | |
Xet Storage Details
- Size:
- 1.1 kB
- Xet hash:
- bbdcdf5797cc62d93a716017641b111e5486a0219351405965598403706ba0f7
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.