refactor: simplify camera capture dialog in Dashboard component
This commit is contained in:
parent
b954e3cb84
commit
8f15ad5971
@ -3,10 +3,6 @@ import { TodayAttendanceAlert } from '@/components/card/today-attendance-alert';
|
|||||||
import { CameraCapture } from '@/components/inputs';
|
import { CameraCapture } from '@/components/inputs';
|
||||||
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui/card';
|
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui/card';
|
||||||
import { ChartContainer, ChartLegend, ChartLegendContent, ChartTooltip, ChartTooltipContent, type ChartConfig } from '@/components/ui/chart';
|
import { ChartContainer, ChartLegend, ChartLegendContent, ChartTooltip, ChartTooltipContent, type ChartConfig } from '@/components/ui/chart';
|
||||||
import {
|
|
||||||
Dialog,
|
|
||||||
DialogContent,
|
|
||||||
} from '@/components/ui/dialog';
|
|
||||||
import { useCan } from '@/hooks/use-can';
|
import { useCan } from '@/hooks/use-can';
|
||||||
import { generateRandomColors } from '@/lib/utils';
|
import { generateRandomColors } from '@/lib/utils';
|
||||||
import { formatRupiah } from '@/lib/rupiah';
|
import { formatRupiah } from '@/lib/rupiah';
|
||||||
@ -310,14 +306,12 @@ export default function Dashboard({
|
|||||||
onCheckOut={handleCheckOut}
|
onCheckOut={handleCheckOut}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<Dialog open={showCamera} onOpenChange={setShowCamera}>
|
{showCamera && (
|
||||||
<DialogContent>
|
<CameraCapture
|
||||||
<CameraCapture
|
onCapture={handleCameraCapture}
|
||||||
onCapture={handleCameraCapture}
|
onClose={() => setShowCamera(false)}
|
||||||
onClose={() => setShowCamera(false)}
|
/>
|
||||||
/>
|
)}
|
||||||
</DialogContent>
|
|
||||||
</Dialog>
|
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user