Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat:central workshop page #189

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
123 changes: 120 additions & 3 deletions app/[locale]/institute/sections/central-workshop/page.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
import WorkInProgress from '~/components/work-in-progress';
import { Fragment, Suspense } from 'react';

import ImageHeader from '~/components/image-header';
import {
Table,
TableBody,
TableCell,
TableHead,
TableHeader,
TableRow,
} from '~/components/ui';
import { getTranslations } from '~/i18n/translations';
import { db } from '~/server/db';

Expand All @@ -12,6 +22,113 @@ export default async function CentralWorkshop({
const section = (await db.query.sections.findFirst({
where: (section, { eq }) => eq(section.urlName, 'central-workshop'),
}))!;

return <WorkInProgress locale={locale} />;
return (
<>
<ImageHeader title={text.title} src="assets/central-workshop.jpg" />
<section className="container">
<p>{section?.aboutUs}</p>
<h4>{text.organization}</h4>
<h5>{text.organizationSub}</h5>
<ul className="mb-5 mt-1 list-inside list-disc">
{text.organizationDetails.map((item, index) => (
<li key={index}>{item}</li>
))}
</ul>
<h4>{text.services}</h4>
<h5>{text.servicesSub}</h5>
<ul className="mb-5 mt-1 list-inside list-disc">
{text.servicesDetails.map((item, index) => (
<li key={index}>{item}</li>
))}
</ul>
{Object.freeze([
'facilities',
'machineShop',
'productionShop',
'fittingShop',
'patternShop',
'foundryShop',
'weldingShop',
'camLabs',
] as const).map((category, index) => (
<Fragment key={index}>
<h4>{text[category].title}</h4>
{category === 'facilities' && <h5>{text[category].sub}</h5>}
<Table scrollAreaClassName={index === 0 ? 'mb-10' : 'mb-7'}>
<TableHeader>
<TableRow>
<TableHead>{text.tableTitle.sno}</TableHead>
<TableHead>{text.tableTitle.name}</TableHead>
<TableHead className="text-center">
{text.tableTitle.quantity}
</TableHead>
</TableRow>
</TableHeader>
<TableBody>
{text[category].data.map(({ name, quantity }, index) => (
<TableRow key={index}>
<TableCell>{index + 1}</TableCell>
<TableCell>{name}</TableCell>
<TableCell className="text-center">{quantity}</TableCell>
</TableRow>
))}
{'miscDetails' in text[category] && (
<>
<TableRow>
<TableHead colSpan={3}>{text.miscTitle}</TableHead>
</TableRow>
<TableRow>
<TableCell colSpan={3}>
{/* @ts-expect-error: current ts version doesnt properly narrow type */}
{text[category].miscDetails as string}
</TableCell>
</TableRow>
</>
)}
</TableBody>
</Table>
{index == 0 && (
<h4 className="text-shade-dark">{text.equipmentDetails}</h4>
)}
</Fragment>
))}
<h4>{text.staffTitle}</h4>
<Table>
<TableHeader>
<TableRow>
<TableHead>{text.staffTableTitle.name}</TableHead>
<TableHead>{text.staffTableTitle.designation}</TableHead>
</TableRow>
</TableHeader>
<TableBody>
<Suspense
fallback={
<TableRow>
<TableCell colSpan={2} rowSpan={2}>
Loading...
</TableCell>
</TableRow>
}
>
<DelayedStaff id={section.id} />
</Suspense>
</TableBody>
</Table>
</section>
</>
);
}

const DelayedStaff = async ({ id }: { id: number }) => {
const staff = await db.query.staff.findMany({
columns: { id: true, designation: true },
where: (staff, { eq }) => eq(staff.workingSectionId, id),
with: { person: { columns: { name: true, email: true, telephone: true } } },
});
return staff.map(({ designation, person: { name } }, index) => (
<TableRow key={index}>
<TableCell>{name}</TableCell>
<TableCell>{designation}</TableCell>
</TableRow>
));
};
172 changes: 171 additions & 1 deletion i18n/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,177 @@ const text: Translations = {

Account: {},
CentralLibrary: {},
CentralWorkshop: {},
CentralWorkshop: {
title: 'CENTRAL WORKSHOP',
organization: 'Organization',
organizationSub:
' Central workshop is the central facility of the institute for all the disciplines of engineering. It is entrusted with the following responsibility.',
organizationDetails: [
'Provide training to all B. tech. 1st year students of all discipline, 2nd year & 3rd year students of Production & Industrial engineering and Mechanical discipline.',
'Provide hand on experience to run the machine & use of equipment in the machine shop, pattern making shop, foundry shop, welding shop, production technology lab & advance manufacturing lab and other manufacture process by visual demonstration.',
'Helps the students to understand the actual behavior and hardship of the industrial working culture.',
'Helps in building the confidence of the students in the various manufacturing processes.',
],
services: 'Services',
servicesSub: 'Provide support/ assistance for :',
servicesDetails: [
'Project work – undergraduate/ post graduate students.',
'Research work – PhD students.',
'Looks after institute vehicles maintenances.',
'Looks after institute furniture repair & maintenance work.',
],
tableTitle: {
sno: 'S.No.',
name: 'Machines & equipments Name',
quantity: 'Quantity',
},
miscTitle: 'Measuring Instruments/Equipment',
facilities: {
title: 'Facilities',
sub: ' The Central Workshop comprises of the following fully equipped shops.',
data: [
{ name: 'Machine shop', quantity: '29' },
{ name: 'Production Technology lab', quantity: '17' },
{ name: 'Fitting shop', quantity: '3' },
{ name: 'Pattern Making shop', quantity: '9' },
{ name: 'Foundry shop', quantity: '20' },
{ name: 'Welding shop', quantity: '21' },
{ name: 'CAM Lab', quantity: '1' },
],
},
equipmentDetails:
'Lab wise details of machinery & equipment are as follows:',
machineShop: {
title: 'Machine Shop',
data: [
{ name: 'Lathe machine', quantity: '9' },
{ name: 'CMT Lathe LB-17', quantity: '7' },
{ name: 'Kirloskar lathe', quantity: '5' },
{ name: 'Power Hacksaw', quantity: '1' },
{ name: 'Horizontal milling machine', quantity: '1' },
{ name: 'Vertical Milling machine', quantity: '1' },
{ name: 'Tool & cutter grinder', quantity: '1' },
{ name: 'DE pedestal grinder', quantity: '1' },
{ name: 'Radial drill', quantity: '1' },
{ name: 'Shaper 24”', quantity: '1' },
{ name: 'Metal cutting machine', quantity: '1' },
],

miscDetails:
'Plain/digital vernier caliper, Bore gauge, Lever type dial indicator, Contactless tachometer, Plain/digital micrometer, sine bar 10”, granite comparator stand & adjustable snap gauge.',
},
productionShop: {
title: 'Production Technology Shop',
data: [
{ name: 'Cylindrical grinder', quantity: '1' },
{ name: 'Radial drilling', quantity: '1' },
{ name: 'Vertical milling', quantity: '1' },
{ name: 'Universal milling', quantity: '1' },
{ name: 'Gear hobbing', quantity: '1' },
{ name: 'Horizontal milling', quantity: '1' },
{ name: 'Pillar type drill', quantity: '1' },
{ name: 'Drill machine 1”', quantity: '1' },
{ name: 'HMT lathe (NH-22)', quantity: '1' },
{ name: 'Leading lathe', quantity: '4' },
{ name: 'EDM machine', quantity: '1' },
{ name: 'Drill machine ½”', quantity: '1' },
{ name: 'Metal cutting machine', quantity: '1' },
{ name: 'Cobra Power hacksaw', quantity: '1' },
],
miscDetails:
'Plain/digital vernier caliper, Adjustable snap gauge, Bore gauge, Lever type dial indicator, Plain/digital micrometer & dial indicator.',
},
fittingShop: {
title: 'Fitting Shop',
data: [
{ name: 'Power hacksaw', quantity: '1' },
{ name: 'Drill machine 25 mm', quantity: '1' },
{ name: 'Drill machine 20 mm', quantity: '1' },
],
miscDetails:
'Plain/digital vernier, Plain/digital micrometer, Plain/Digital vernier height gauge, Surface plates & Bench vice.',
},
patternShop: {
title: 'Pattern Making Shop',
data: [
{ name: 'Band saw machine with motor', quantity: '1' },
{ name: 'Wood circular cutter GCM 12', quantity: '1' },
{ name: 'Plane sander GSS140A', quantity: '1' },
{ name: 'Planer GHO 10-82', quantity: '1' },
{ name: 'Wood cutter GTS-10', quantity: '1' },
{ name: 'Wood working lathe', quantity: '1' },
{ name: 'Rotary hand hammer drill', quantity: '1' },
{ name: 'Drill machine 20 mm', quantity: '1' },
{ name: 'Grinder machine', quantity: '1' },
],
miscDetails:
'Bench vices, different types of files, different types of saws & different types of planes.',
},
foundryShop: {
title: 'Foundry Shop',
data: [
{ name: 'Aluminium melting furnace', quantity: '1' },
{ name: 'Digital sieve shaker versatile', quantity: '1' },
{ name: 'Sieve shaker', quantity: '1' },
{ name: 'Open hearth blower', quantity: '1' },
{ name: 'Cupla furnace', quantity: '1' },
{ name: 'Universal sand testing machine', quantity: '2' },
{ name: 'Permeability meter', quantity: '2' },
{ name: 'Hand moulding machine', quantity: '1' },
{ name: 'Moisture tester', quantity: '1' },
{ name: 'Green hardness tester', quantity: '1' },
{ name: 'Weighting scale', quantity: '1' },
{ name: 'Moisture tester', quantity: '1' },
{ name: 'Compressive strength testing', quantity: '1' },
{ name: 'High temperature tubular furnace', quantity: '1' },
{ name: 'Grinding with vibration control', quantity: '1' },
{ name: 'Straight grinder', quantity: '1' },
{ name: 'Rapid sand washing machine', quantity: '1' },
{ name: 'Electric riddle', quantity: '1' },
],
},
weldingShop: {
title: 'Welding Shop',
data: [
{ name: 'Hand shear machine', quantity: '1' },
{ name: '½”portable drill machine', quantity: '1' },
{ name: 'Portable sheet metal shear machine', quantity: '1' },
{
name: 'Nibbler (sheet metal profile cutting machine portable)',
quantity: '1',
},
{ name: 'Portable Jig –Jag profile cutting machine', quantity: '1' },
{
name: 'Portable chop- saw m/c (abrasive wheel type metal cutting machine)',
quantity: '1',
},
{ name: 'Tig welding set (25-250A)', quantity: '1' },
{ name: 'Mig welding set (25-250A)', quantity: '1' },
{ name: 'AC arc welding transformer', quantity: '3' },
{ name: 'MIG welding', quantity: '1' },
{ name: 'Power hacksaw', quantity: '2' },
{ name: 'Pedestal grinder 200/250 mm', quantity: '1' },
{ name: 'Submerged arc welding 1200 amp.', quantity: '1' },
{ name: 'Bosch metal cutting chop saw', quantity: '1' },
{ name: 'Shunt type welding rectifier (TSR-300)', quantity: '1' },
{ name: 'Portable oil cooled transformer (2/300 ST)', quantity: '1' },
{ name: 'Welding postioner/ manipulator (MH-500)', quantity: '1' },
{
name: 'Magnetic crack detector standard accessories',
quantity: '1',
},
],
},
camLabs: {
title: 'CAM Lab',
data: [{ name: 'AMS system', quantity: '1' }],
},
staffTitle: 'Administrative and Technical Staff',
staffTableTitle: {
name: 'Name',
designation: 'Designation',
},
},
CentreOfComputingAndNetworking: {},
ElectricalMaintenance: {},
Estate: {},
Expand Down
Loading