Skip to content

Commit

Permalink
refactor: unnecessary data when there are no appointment
Browse files Browse the repository at this point in the history
  • Loading branch information
Samuel Molendolff Teixeira committed Apr 30, 2024
1 parent d11e602 commit b9152ff
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 20 deletions.
12 changes: 1 addition & 11 deletions src/components/home/command-actions.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
CommandList,
} from '@/components/ui/command'

import { SignOut, GearSix } from '@phosphor-icons/react'
import { SignOut } from '@phosphor-icons/react'

import { useEffect, useState } from 'react'
import { Button } from '../ui/button'
Expand Down Expand Up @@ -53,16 +53,6 @@ export default function CommandActions() {
<span>Sair</span>
</Button>
</CommandItem>

<CommandItem className="aria-selected:bg-background !p-0 !m-0">
<Button
variant={'ghost'}
className="w-full justify-start cursor-default px-2 py-1.5 text-sm font-normal"
>
<GearSix className="mr-2 h-4 w-4" />
<span>Configurações</span>
</Button>
</CommandItem>
</CommandGroup>
</CommandList>
</CommandDialog>
Expand Down
28 changes: 19 additions & 9 deletions src/pages/Home/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,20 +66,30 @@ export default function Home() {

<div>
<div>
<p
data-testid="guiche"
className="text-5xl text-center font-raleway leading-tight"
>
{`Guichê ${tickets[0]?.guiche || '0'} - Setor ${
tickets[0]?.setor || '...'
}`}
</p>
<div className="flex gap-2 justify-center">
<p
data-testid="guiche"
className="text-5xl text-center font-raleway leading-tight"
>
{tickets[0]?.guiche ? `Guichê ${tickets[0]?.guiche}` : ''}
</p>

<span className="text-5xl font-raleway leading-tight ">
{!!tickets[0]?.guiche && !!tickets[0]?.setor && '-'}
</span>

<p className="text-5xl text-center font-raleway leading-tight">
{tickets[0]?.setor ? `Setor ${tickets[0]?.setor}` : ''}
</p>
</div>

<p
data-testid="prioridade"
className="text-5xl text-center font-raleway leading-tight"
>
{`Atendimento ${tickets[0]?.description || ''}`}
{tickets[0]?.description
? `Atendimento ${tickets[0]?.description}`
: ''}
</p>
</div>

Expand Down
16 changes: 16 additions & 0 deletions vite.config.js.timestamp-1714475292592-dfb08d75bcf3a.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// vite.config.js
import { defineConfig } from "file:///C:/Users/samuel.teixeira/Documents/projects/painel-de-chamadas/node_modules/.pnpm/vite@5.0.11/node_modules/vite/dist/node/index.js";
import react from "file:///C:/Users/samuel.teixeira/Documents/projects/painel-de-chamadas/node_modules/.pnpm/@vitejs+plugin-react@4.2.1_vite@5.0.11/node_modules/@vitejs/plugin-react/dist/index.mjs";
import jsconfigPaths from "file:///C:/Users/samuel.teixeira/Documents/projects/painel-de-chamadas/node_modules/.pnpm/vite-jsconfig-paths@2.0.1_vite@5.0.11/node_modules/vite-jsconfig-paths/dist/index.mjs";
var vite_config_default = defineConfig({
plugins: [react(), jsconfigPaths()],
test: {
globals: true,
setupFiles: ["./test/setup.js"],
environment: "jsdom"
}
});
export {
vite_config_default as default
};
//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsidml0ZS5jb25maWcuanMiXSwKICAic291cmNlc0NvbnRlbnQiOiBbImNvbnN0IF9fdml0ZV9pbmplY3RlZF9vcmlnaW5hbF9kaXJuYW1lID0gXCJDOlxcXFxVc2Vyc1xcXFxzYW11ZWwudGVpeGVpcmFcXFxcRG9jdW1lbnRzXFxcXHByb2plY3RzXFxcXHBhaW5lbC1kZS1jaGFtYWRhc1wiO2NvbnN0IF9fdml0ZV9pbmplY3RlZF9vcmlnaW5hbF9maWxlbmFtZSA9IFwiQzpcXFxcVXNlcnNcXFxcc2FtdWVsLnRlaXhlaXJhXFxcXERvY3VtZW50c1xcXFxwcm9qZWN0c1xcXFxwYWluZWwtZGUtY2hhbWFkYXNcXFxcdml0ZS5jb25maWcuanNcIjtjb25zdCBfX3ZpdGVfaW5qZWN0ZWRfb3JpZ2luYWxfaW1wb3J0X21ldGFfdXJsID0gXCJmaWxlOi8vL0M6L1VzZXJzL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