Skip to content

Commit

Permalink
Revert "define asset directly in assetcard.astro"
Browse files Browse the repository at this point in the history
This reverts commit f5229d7.
  • Loading branch information
xbubbo committed Oct 21, 2024
1 parent f5229d7 commit ebf1ad1
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 21 deletions.
23 changes: 2 additions & 21 deletions src/components/AssetCard.astro
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,8 @@ interface Props {
asset: Asset;
}
import { Image } from "astro:assets";
import { ASSET_URL, type Asset } from "@/lib/asset";
import { Ban, CircleAlert, UserRoundPlus } from "lucide-astro";
interface Asset {
name: string;
image: string;
link?: string;
links?: { name: string; url: string }[];
say?: string;
custom?: boolean;
partial?: boolean | string;
error?: boolean | string;
blank?: boolean | string;
}
export const ASSET_URL = "https://raw.githubusercontent.com/UseInterstellar/Interstellar-Assets/main";
const { asset } = Astro.props;
export const prerender = false;
Expand All @@ -35,13 +23,7 @@ export const prerender = false;
<div
class="absolute bottom-0 left-0 w-full h-full bg-black/20 opacity-0 group-hover:opacity-100 rounded-b-md duration-150 flex items-end p-2 px-4 font-semibold transition-all z-10"
>
<section
class="inline-flex items-center gap-2 text-white"
class:list={{
"text-red-600": asset.error,
"text-yellow-400": asset.partial,
}}
>
<section class="inline-flex items-center gap-2 text-white" class:list={{ "text-red-600": asset.error, "text-yellow-400": asset.partial }}>
{asset.custom && <UserRoundPlus class="size-5" />}
{asset.partial && <CircleAlert class="size-5" />}
{asset.error && <Ban class="size-5" />}
Expand All @@ -52,5 +34,4 @@ export const prerender = false;
</div>
</div>
</button>

<script src="@/lib/assets.ts"></script>
14 changes: 14 additions & 0 deletions src/lib/asset.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
export const ASSET_URL =
"https://raw.githubusercontent.com/UseInterstellar/Interstellar-Assets/main";

export type Asset = {
name: string;
image: string;
link?: string;
links?: { name: string; url: string }[];
say?: string;
custom?: boolean;
partial?: boolean | string;
error?: boolean | string;
blank?: boolean | string;
};

0 comments on commit ebf1ad1

Please sign in to comment.