move info to its own file

This commit is contained in:
Hailey
2024-04-12 22:18:56 -07:00
parent 4b3ec55732
commit 1d45a2f403
2 changed files with 14 additions and 11 deletions
+2 -11
View File
@@ -8,10 +8,10 @@ import {
AppBskyGraphDefs,
AppBskyLabelerDefs,
} from '@atproto/api'
import {ComponentChildren, h} from 'preact'
import {h} from 'preact'
import infoIcon from '../../assets/circleInfo_stroke2_corner0_rounded.svg'
import {getRkey} from '../utils'
import {Info} from './info'
import {Link} from './link'
export function Embed({content}: {content: AppBskyFeedDefs.PostView['embed']}) {
@@ -159,15 +159,6 @@ export function Embed({content}: {content: AppBskyFeedDefs.PostView['embed']}) {
}
}
function Info({children}: {children: ComponentChildren}) {
return (
<div className="w-full rounded-lg border py-2 px-2.5 flex-row flex gap-2 bg-neutral-50">
<img src={infoIcon as string} className="w-4 h-4 shrink-0 mt-0.5" />
<p className="text-sm text-textLight">{children}</p>
</div>
)
}
function ImageEmbed({content}: {content: AppBskyEmbedImages.View}) {
switch (content.images.length) {
case 1:
+12
View File
@@ -0,0 +1,12 @@
import {ComponentChildren, h} from 'preact'
import infoIcon from '../../assets/circleInfo_stroke2_corner0_rounded.svg'
export function Info({children}: {children: ComponentChildren}) {
return (
<div className="w-full rounded-lg border py-2 px-2.5 flex-row flex gap-2 bg-neutral-50">
<img src={infoIcon} className="w-4 h-4 shrink-0 mt-0.5" />
<p className="text-sm text-textLight">{children}</p>
</div>
)
}