This repository has been archived by the owner on Nov 4, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: rework details panel * chore: cleanup * chore: cleanup * chore: cleanup
- Loading branch information
1 parent
ead271b
commit f8095a9
Showing
15 changed files
with
401 additions
and
324 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
60 changes: 0 additions & 60 deletions
60
apps/customer-service/src/components/infos/info-summary.tsx
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
apps/customer-service/src/components/infos/ticket-info.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import { FC } from 'react'; | ||
import { FormattedMessage } from 'react-intl'; | ||
|
||
import { TicketAssignmentDropdown } from '~/components/tickets/ticket-assignment-dropdown'; | ||
import { TicketStatusDropdowm } from '~/components/tickets/ticket-status-dropdown'; | ||
import { api } from '~/utils/api'; | ||
|
||
export const TicketInfo: FC<{ ticketId: number }> = ({ ticketId }) => { | ||
const { data: ticketData } = api.ticket.byId.useQuery({ | ||
id: ticketId, | ||
}); | ||
|
||
if (!ticketData) { | ||
return null; | ||
} | ||
|
||
return ( | ||
<dl className="grid grid-cols-[5rem,_1fr] items-center gap-x-3 gap-y-2 border-b py-4"> | ||
<dt className="text-sm leading-8"> | ||
<FormattedMessage id="info_panel.ticket_panel.status" /> | ||
</dt> | ||
<dd className="truncate text-sm leading-5 text-muted-foreground"> | ||
<TicketStatusDropdowm status={ticketData?.status} ticketId={ticketId} /> | ||
</dd> | ||
|
||
<dt className="text-sm leading-8"> | ||
<FormattedMessage id="info_panel.ticket_panel.assignee" /> | ||
</dt> | ||
<dd className="truncate text-sm leading-5 text-muted-foreground"> | ||
<TicketAssignmentDropdown | ||
assignedTo={ticketData?.assignedTo} | ||
ticketId={ticketId} | ||
/> | ||
</dd> | ||
</dl> | ||
); | ||
}; |
71 changes: 0 additions & 71 deletions
71
apps/customer-service/src/components/infos/user-info-panel.tsx
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
import { FC } from 'react'; | ||
import { FormattedMessage } from 'react-intl'; | ||
|
||
import { PhoneNumber } from '~/components/infos/phone-number'; | ||
import { Copy } from '~/components/ui/copy'; | ||
import { api } from '~/utils/api'; | ||
|
||
const user = { | ||
app: { | ||
platform: 'android', | ||
version: '1.0.0', | ||
}, | ||
}; | ||
|
||
export const UserInfo: FC<{ ticketId: number }> = ({ ticketId }) => { | ||
const { data: ticketData } = api.ticket.byId.useQuery({ | ||
id: ticketId, | ||
}); | ||
|
||
if (!ticketData) { | ||
return null; | ||
} | ||
|
||
return ( | ||
<dl className="grid grid-cols-[5rem,_1fr] items-center gap-x-3 gap-y-4"> | ||
<dt className="flex flex-none items-center"> | ||
<FormattedMessage id="info_panel.user_panel.name" /> | ||
</dt> | ||
<dd className="truncate text-sm leading-5 text-muted-foreground"> | ||
{ticketData.author.name ? ( | ||
<Copy content={ticketData.author.name}>{ticketData.author.name}</Copy> | ||
) : ( | ||
<span> | ||
<FormattedMessage id="not_documented" /> | ||
</span> | ||
)} | ||
</dd> | ||
|
||
<dt className="flex flex-none items-center"> | ||
<FormattedMessage id="info_panel.user_panel.email" /> | ||
</dt> | ||
<dd className="truncate text-sm leading-5 text-muted-foreground"> | ||
{ticketData.author.email ? ( | ||
<Copy content={ticketData.author.email}> | ||
{ticketData.author.email} | ||
</Copy> | ||
) : ( | ||
<span> | ||
<FormattedMessage id="not_documented" /> | ||
</span> | ||
)} | ||
</dd> | ||
|
||
<dt className="flex flex-none items-center"> | ||
<FormattedMessage id="info_panel.user_panel.phone_number" /> | ||
</dt> | ||
<dd className="truncate text-sm leading-5 text-muted-foreground"> | ||
{ticketData.author.phone ? ( | ||
<Copy content={ticketData.author.phone}> | ||
<PhoneNumber value={ticketData.author.phone} /> | ||
</Copy> | ||
) : ( | ||
<span> | ||
<FormattedMessage id="not_documented" /> | ||
</span> | ||
)} | ||
</dd> | ||
|
||
<dt className="flex flex-none items-center"> | ||
<FormattedMessage id="user.platform" /> | ||
</dt> | ||
<dd className="truncate text-sm leading-5 text-muted-foreground"> | ||
<Copy content={user.app.version}>{user.app.version}</Copy> | ||
</dd> | ||
</dl> | ||
); | ||
}; |
Oops, something went wrong.