Bläddra i källkod

filename length

Bernt Christian Egeland 9 månader sedan
förälder
incheckning
8fd67aa110

+ 6 - 6
src/features/vehicles/Components/service-detail/ServiceAttachments.tsx

@@ -29,12 +29,12 @@ function AttachmentRow({
   deleting: boolean;
   deleting: boolean;
 }) {
 }) {
   return (
   return (
-    <div className="flex items-center gap-2 rounded border p-2">
-      <div className="flex h-8 w-8 flex-shrink-0 items-center justify-center rounded bg-muted/50">
+    <div className="grid grid-cols-[2rem_1fr_auto] items-center gap-2 rounded border p-2">
+      <div className="flex h-8 w-8 items-center justify-center rounded bg-muted/50">
         {getFileIcon(attachment.fileType)}
         {getFileIcon(attachment.fileType)}
       </div>
       </div>
-      <div className="min-w-0 flex-1">
-        <p className="truncate text-xs font-medium">{attachment.fileName}</p>
+      <div className="overflow-hidden">
+        <p className="truncate text-xs font-medium" title={attachment.fileName}>{attachment.fileName}</p>
         <p className="text-xs text-muted-foreground">{formatFileSize(attachment.fileSize)}</p>
         <p className="text-xs text-muted-foreground">{formatFileSize(attachment.fileSize)}</p>
       </div>
       </div>
       <div className="flex items-center gap-0.5">
       <div className="flex items-center gap-0.5">
@@ -124,7 +124,7 @@ export function ServiceAttachments({
       )}
       )}
 
 
       {diagnostics.length > 0 && (
       {diagnostics.length > 0 && (
-        <div className="rounded-lg border p-3">
+        <div className="min-w-0 overflow-hidden rounded-lg border p-3">
           <h3 className="mb-2 flex items-center gap-2 text-sm font-semibold">
           <h3 className="mb-2 flex items-center gap-2 text-sm font-semibold">
             <FileText className="h-3.5 w-3.5" />
             <FileText className="h-3.5 w-3.5" />
             Diagnostic Reports ({diagnostics.length})
             Diagnostic Reports ({diagnostics.length})
@@ -143,7 +143,7 @@ export function ServiceAttachments({
       )}
       )}
 
 
       {documents.length > 0 && (
       {documents.length > 0 && (
-        <div className="rounded-lg border p-3">
+        <div className="min-w-0 overflow-hidden rounded-lg border p-3">
           <h3 className="mb-2 flex items-center gap-2 text-sm font-semibold">
           <h3 className="mb-2 flex items-center gap-2 text-sm font-semibold">
             <Paperclip className="h-3.5 w-3.5" />
             <Paperclip className="h-3.5 w-3.5" />
             Documents ({documents.length})
             Documents ({documents.length})

+ 4 - 4
src/features/vehicles/Components/service-detail/ServiceDetailHeader.tsx

@@ -39,13 +39,13 @@ export function ServiceDetailHeader({
 }: ServiceDetailHeaderProps) {
 }: ServiceDetailHeaderProps) {
   return (
   return (
     <div className="shrink-0 border-b bg-background px-4 pt-2 pb-2">
     <div className="shrink-0 border-b bg-background px-4 pt-2 pb-2">
-      <div className="grid grid-cols-[1fr_auto] items-center gap-4">
+      <div className="flex min-w-0 items-center gap-4">
         <Link
         <Link
           href={`/vehicles/${vehicleId}`}
           href={`/vehicles/${vehicleId}`}
-          className="flex items-center gap-3 overflow-hidden text-foreground transition-colors hover:text-muted-foreground"
+          className="flex min-w-0 flex-1 items-center gap-3 text-foreground transition-colors hover:text-muted-foreground"
         >
         >
           <ArrowLeft className="h-4 w-4 shrink-0" />
           <ArrowLeft className="h-4 w-4 shrink-0" />
-          <div className="overflow-hidden">
+          <div className="min-w-0">
             <div className="flex items-center gap-2">
             <div className="flex items-center gap-2">
               <Badge
               <Badge
                 variant="outline"
                 variant="outline"
@@ -65,7 +65,7 @@ export function ServiceDetailHeader({
             </p>
             </p>
           </div>
           </div>
         </Link>
         </Link>
-        <div className="flex items-center gap-2">
+        <div className="flex shrink-0 items-center gap-2">
           <Button variant="outline" size="sm" asChild>
           <Button variant="outline" size="sm" asChild>
             <Link href={`/vehicles/${vehicleId}/service/${recordId}/edit`}>
             <Link href={`/vehicles/${vehicleId}/service/${recordId}/edit`}>
               <Pencil className="mr-1 h-3.5 w-3.5" />
               <Pencil className="mr-1 h-3.5 w-3.5" />