Skip to content

Commit

Permalink
Move style inside the component
Browse files Browse the repository at this point in the history
  • Loading branch information
krishaamer committed May 6, 2024
1 parent 3ac9ad4 commit 09f6321
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 18 deletions.
4 changes: 1 addition & 3 deletions components/chat-list.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@ export function ChatList({ messages }: { messages: any[] }) {

return (
<div className="relative mx-auto max-w-2xl px-4">
<div className="rounded-xl text-card-foreground border p-2 mt-2 mb-6">
<Origin />
</div>
<Origin />
{messages.map((message, index) => (
<div key={index}>{message.display}</div>
))}
Expand Down
29 changes: 14 additions & 15 deletions components/origin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,21 +24,20 @@ export default function Origin() {
}, [searchParams]);

return (
<div>
{reportID &&
origin.url && (
<span>
資料來源:
<a
href={origin.url}
target="_blank"
rel="noopener noreferrer"
className="link font-bold"
>
{getDomainFromURL(origin.url)}
</a>
</span>
)}
<div className="rounded-xl text-card-foreground border p-2 mt-2 mb-6">
{reportID && origin.url && (
<span>
資料來源:
<a
href={origin.url}
target="_blank"
rel="noopener noreferrer"
className="link font-bold"
>
{getDomainFromURL(origin.url)}
</a>
</span>
)}
</div>
);
}

0 comments on commit 09f6321

Please sign in to comment.