Skip to content

Commit

Permalink
Show mash cmd even on detail pages ofc
Browse files Browse the repository at this point in the history
  • Loading branch information
mxcl committed Jan 16, 2024
1 parent 4db8da2 commit 9a20fd7
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/mash.pkgx.sh/ScriptDetail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@ export interface Script {
avatar: string
url: string
README?: string
cmd: string
}

export default function ScriptComponent({fullname, birthtime, README: description, avatar, url}: Script) {
export default function ScriptComponent({fullname, birthtime, cmd, README: description, avatar, url}: Script) {
const {loading, error, value: content} = useAsync(async () => {
const rsp = await fetch(`https://pkgxdev.github.io/mash/u/${fullname}`)
return await rsp.text()
Expand All @@ -29,7 +30,10 @@ export default function ScriptComponent({fullname, birthtime, README: descriptio
<Typography>{fullname}</Typography>
<Typography variant='caption'>{timeAgo(birthtime)}</Typography>
</Stack>
{description && <Markdown txt={description} />}
{description
? <Markdown txt={description} />
: <Terminal>{cmd}</Terminal>
}
{excerpt()}
<Stack direction='row' spacing={2}>
<Button variant='contained' href={url} target='github'>GitHub <ArrowOutwardIcon/></Button>
Expand Down

0 comments on commit 9a20fd7

Please sign in to comment.