mirror of
https://gitea.tendokyu.moe/ppc/amnet.git
synced 2026-09-22 22:28:22 +03:00
make server title clickable
This commit is contained in:
@@ -9,12 +9,13 @@ export interface AMCardActionProps {
|
||||
actionDisabled?: boolean,
|
||||
}
|
||||
|
||||
export function AMCard(props: AMCardActionProps & { title: string, children: Readonly<React.ReactNode> }) {
|
||||
export function AMCard(props: AMCardActionProps & { title: string, titlePerformsAction?: boolean, children: Readonly<React.ReactNode> }) {
|
||||
return (
|
||||
<Card>
|
||||
<div className="grid grid-cols-[1fr_40px] items-center gap-1 p-4 pr-2 sm:p-6">
|
||||
<div className={`${props.actionClicked ? 'grid grid-cols-[1fr_40px] items-center gap-1' : ''} p-4 pr-2 sm:p-6`}>
|
||||
<div className="max-w-full overflow-hidden space-y-3">
|
||||
<h4 className="text-2xl font-semibold select-none text-ellipsis whitespace-nowrap overflow-hidden">
|
||||
<h4 className="text-2xl font-semibold select-none text-ellipsis whitespace-nowrap overflow-hidden"
|
||||
onClick={() => props.titlePerformsAction && props.actionClicked ? props.actionClicked() : null}>
|
||||
{props.title}
|
||||
</h4>
|
||||
<div className="text-sm lg:text-md flex flex-auto flex-wrap gap-3">
|
||||
|
||||
@@ -62,7 +62,7 @@ function ServerList(props: { servers: AimeServer[] | undefined }) {
|
||||
{props.servers.map(s =>
|
||||
<ContextMenu key={s.id}>
|
||||
<ContextMenuTrigger>
|
||||
<AMCard title={s.server_name} actionClicked={() => navigate(`/servers/${s.id}`)}>
|
||||
<AMCard title={s.server_name} titlePerformsAction actionClicked={() => navigate(`/servers/${s.id}`)}>
|
||||
{s.lastConnected > 0 && (
|
||||
<AMCardDetail>
|
||||
<History className="h-5 w-5"/>
|
||||
|
||||
Reference in New Issue
Block a user