fix: style fix. spacing DescItem

This commit is a style fix.
* spacing DescItem component.
* typo fix.
* show file hash
This commit is contained in:
monoid 2024-10-08 02:19:50 +09:00
parent 9fb87d6a3c
commit b79faf3ea9
4 changed files with 14 additions and 10 deletions

View File

@ -20,7 +20,11 @@ export function DescTagItem({
}) { }) {
return <DescItem name={name} className={className}> return <DescItem name={name} className={className}>
{items.length === 0 ? "N/A" : items.map( {items.length === 0 ? "N/A" : items.map(
(x) => <StyledLink key={x} to={`/search?allow_tag=${name}:${x}`}>{x}</StyledLink> (x, i) =>
<>
<StyledLink key={x} to={`/search?allow_tag=${name}:${x}`}>{x}</StyledLink>
{i + 1 < items.length && <span className="">, </span>}
</>
)} )}
</DescItem>; </DescItem>;
} }

View File

@ -1,4 +1,4 @@
import type { Document } from "dbtype/api"; import type { Document } from "dbtype";
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card.tsx"; import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card.tsx";
import TagBadge from "@/components/gallery/TagBadge.tsx"; import TagBadge from "@/components/gallery/TagBadge.tsx";
import { Fragment, useLayoutEffect, useRef, useState } from "react"; import { Fragment, useLayoutEffect, useRef, useState } from "react";

View File

@ -1,5 +1,5 @@
import useSWR from "swr"; import useSWR from "swr";
import type { Document } from "dbtype/api"; import type { Document } from "dbtype";
import { fetcher } from "./fetcher"; import { fetcher } from "./fetcher";
export function useGalleryDoc(id: string) { export function useGalleryDoc(id: string) {

View File

@ -58,14 +58,14 @@ export function ContentInfoPage({ params }: ContentInfoPageProps) {
</CardHeader> </CardHeader>
<CardContent> <CardContent>
<div className="grid gap-4 grid-cols-[repeat(auto_fill_300px)]"> <div className="grid gap-4 grid-cols-[repeat(auto_fill_300px)]">
<DescTagItem name="artist" items={classifiedTags.artist} /> <DescTagItem name="Artist" items={classifiedTags.artist} />
<DescTagItem name="group" items={classifiedTags.group} /> <DescTagItem name="Group" items={classifiedTags.group} />
<DescTagItem name="series" items={classifiedTags.series} /> <DescTagItem name="Series" items={classifiedTags.series} />
<DescTagItem name="character" items={classifiedTags.character} /> <DescTagItem name="Character" items={classifiedTags.character} />
<DescItem name="Created At">{new Date(data.created_at).toLocaleString()}</DescItem> <DescItem name="Created At / Modified At">{new Date(data.created_at).toLocaleString()} / {new Date(data.modified_at).toLocaleString()}</DescItem>
<DescItem name="Modified At">{new Date(data.modified_at).toLocaleString()}</DescItem> <DescItem name="Filehash">{data.content_hash}</DescItem>
<DescItem name="Path">{`${data.basepath}/${data.filename}`}</DescItem> <DescItem name="Path">{`${data.basepath}/${data.filename}`}</DescItem>
<DescItem name="Page Count">{JSON.stringify(data.additional)}</DescItem> <DescItem name="Page Count">{data.pagenum}</DescItem>
</div> </div>
<div className="grid mt-4"> <div className="grid mt-4">
<span className="text-muted-foreground text-sm">Tags</span> <span className="text-muted-foreground text-sm">Tags</span>